Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759047Ab2EYXKZ (ORCPT ); Fri, 25 May 2012 19:10:25 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:44978 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756796Ab2EYXKV (ORCPT ); Fri, 25 May 2012 19:10:21 -0400 MIME-Version: 1.0 In-Reply-To: References: <1337754877-19759-1-git-send-email-yinghai@kernel.org> <1337754877-19759-3-git-send-email-yinghai@kernel.org> <20120525043651.GA1391@google.com> <20120525193716.GA8817@google.com> Date: Fri, 25 May 2012 16:10:20 -0700 X-Google-Sender-Auth: Cc7vZO4JbMAA2AanqFJoJE47tAw Message-ID: Subject: Re: [PATCH 02/11] PCI: Try to allocate mem64 above 4G at first From: Yinghai Lu To: Bjorn Helgaas Cc: Linus Torvalds , Steven Newbury , "H. Peter Anvin" , Andrew Morton , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: multipart/mixed; boundary=e89a8ff1c3d0f592f804c0e478e2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 7781 Lines: 122 --e89a8ff1c3d0f592f804c0e478e2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Fri, May 25, 2012 at 2:55 PM, Bjorn Helgaas wrote: > I think we should fix this with a separate patch that removes > PCIBIOS_MAX_MEM_32 altogether, replacing this use with an explicit > 0xffffffff (or some other "max 32-bit value" symbol). =A0I don't think > there's anything arch-specific about this. > > So I'd like to see two patches here: > =A01) Avoid allocating 64-bit regions for 32-bit BARs > =A02) Try to allocate regions above 4GB for 64-bit BARs Sure. please check updated two patches. Thanks Yinghai --e89a8ff1c3d0f592f804c0e478e2 Content-Type: application/octet-stream; name="32_bit_bar_allocation.patch" Content-Disposition: attachment; filename="32_bit_bar_allocation.patch" Content-Transfer-Encoding: base64 X-Attachment-Id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GV2KTsKSW5kZXg6IGxpbnV4LTIuNi9hcmNoL3g4Ni9p bmNsdWRlL2FzbS9wY2kuaAo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBsaW51eC0yLjYub3JpZy9hcmNoL3g4Ni9p bmNsdWRlL2FzbS9wY2kuaAorKysgbGludXgtMi42L2FyY2gveDg2L2luY2x1ZGUvYXNtL3BjaS5o CkBAIC0xNDksNyArMTQ5LDYgQEAgdm9pZCBkZWZhdWx0X3Jlc3RvcmVfbXNpX2lycXMoc3RydWN0 IHBjaQogCiAvKiBnZW5lcmljIHBjaSBzdHVmZiAqLwogI2luY2x1ZGUgPGFzbS1nZW5lcmljL3Bj aS5oPgotI2RlZmluZSBQQ0lCSU9TX01BWF9NRU1fMzIgMHhmZmZmZmZmZgogCiAjaWZkZWYgQ09O RklHX05VTUEKIC8qIFJldHVybnMgdGhlIG5vZGUgYmFzZWQgb24gcGNpIGJ1cyAqLwpJbmRleDog bGludXgtMi42L2luY2x1ZGUvbGludXgvcGNpLmgKPT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gbGludXgtMi42Lm9y aWcvaW5jbHVkZS9saW51eC9wY2kuaAorKysgbGludXgtMi42L2luY2x1ZGUvbGludXgvcGNpLmgK QEAgLTEzNDAsMTAgKzEzNDAsNiBAQCBzdGF0aWMgaW5saW5lIGludCBwY2lfZG9tYWluX25yKHN0 cnVjdCBwCiAKICNpbmNsdWRlIDxhc20vcGNpLmg+CiAKLSNpZm5kZWYgUENJQklPU19NQVhfTUVN XzMyCi0jZGVmaW5lIFBDSUJJT1NfTUFYX01FTV8zMiAoLTEpCi0jZW5kaWYKLQogLyogdGhlc2Ug aGVscGVycyBwcm92aWRlIGZ1dHVyZSBhbmQgYmFja3dhcmRzIGNvbXBhdGliaWxpdHkKICAqIGZv ciBhY2Nlc3NpbmcgcG9wdWxhciBQQ0kgQkFSIGluZm8gKi8KICNkZWZpbmUgcGNpX3Jlc291cmNl X3N0YXJ0KGRldiwgYmFyKQkoKGRldiktPnJlc291cmNlWyhiYXIpXS5zdGFydCkK --e89a8ff1c3d0f592f804c0e478e2 Content-Type: application/octet-stream; name="allocate_high_at_first_v4.patch" Content-Disposition: attachment; filename="allocate_high_at_first_v4.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_h2nv4nvh1 U3ViamVjdDogW1BBVENIXSBQQ0k6IFRyeSB0byBhbGxvY2F0ZSBtZW02NCBhYm92ZSA0RyBhdCBm aXJzdAoKYW5kIHdpbGwgZmFsbCBiYWNrIHRvIGJlbG93IDRnIGlmIGl0IGNhbiBub3QgZmluZCBh bnkgYWJvdmUgNGcuCgp4ODYgMzJiaXQgd2l0aG91dCBYODZfUEFFIHN1cHBvcnQgd2lsbCBoYXZl IGJvdHRvbSBzZXQgdG8gMCwgYmVjdWFzZQpyZXNvdXJjZV9zaXplX3QgaXMgMzJiaXQuCgpBbHNv IGZvciAzMmJpdCB3aXRoIHJlc291cmNlX3NpemVfdCA2NGJpdCBrZXJuZWwgb24gbWFjaGluZSB3 aXRoIHBhZSBzdXBwb3J0CndlIGFyZSBzYWZlIGJlY2F1c2UgaW9tZW1fcmVzb3VyY2UgaXMgbGlt aXRlZCB0byAzMmJpdCBhY2NvcmRpbmcgdG8KeDg2X3BoeXNfYml0cy4KCi12MjogdXBkYXRlIGJv dHRvbSBhc3NpZ25pbmcgdG8gbWFrZSBpdCBjbGVhciBmb3Igbm9uLXBhZSBzdXBwb3J0IG1hY2hp bmUuCi12MzogQmpvcm4ncyBjaGFuZ2U6Cgl1c2UgTUFYX1JFT1VSQ0UgaW5zdGVhZCBvZiAtMQoJ dXNlIHN0YXJ0L2VuZCBpbnN0ZWFkIG9mIGJvdHRvbS9tYXgKCWZvciBhbGwgYXJjaCBpbnN0ZWFk IG9mIGp1c3QgeDg2XzY0Ci12NDogdXBkYX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BpZiB0aGUgcHJl ZiBtZW0gZG9lc24ndCBzdXBwb3J0IDY0Yml0CisJICogYWxzbyBpZiB0aGlzIGlzIGEgNjQtYml0 IG1lbSByZXNvdXJjZSwgdHJ5IGFib3ZlIDRHQiBmaXJzdAorCSAqLworCWlmIChyZXMtPmZsYWdz ICYgSU9SRVNPVVJDRV9NRU0pIHsKKwkJaWYgKCEocmVzLT5mbGFncyAmIElPUkVTT1VSQ0VfTUVN XzY0KSkKKwkJCWVuZCA9IFBDSV9NQVhfUkVTT1VSQ0VfMzI7CisJCWVsc2UKKwkJCXN0YXJ0ID0g KHJlc291cmNlX3NpemVfdCkoMVVMTDw8MzIpOworCX0KIAorYWdhaW46CiAJcGNpX2J1c19mb3Jf ZWFjaF9yZXNvdXJjZShidXMsIHIsIGkpIHsKIAkJaWYgKCFyKQogCQkJY29udGludWU7CkBAIC0x NDUsMTIgKzE1NCwxOCBAQCBwY2lfYnVzX2FsbG9jX3Jlc291cmNlKHN0cnVjdCBwY2lfYnVzICpi CiAKIAkJLyogT2ssIHRyeSBpdCBvdXQuLiAqLwogCQlyZXQgPSBhbGxvY2F0ZV9yZXNvdXJjZShy LCByZXMsIHNpemUsCi0JCQkJCXItPnN0YXJ0ID8gOiBtaW4sCi0JCQkJCW1heCwgYWxpZ24sCisJ CQkJCW1heChzdGFydCwgci0+c3RhcnQgPyA6IG1pbiksCisJCQkJCWVuZCwgYWxpZ24sCiAJCQkJ CWFsaWduZiwgYWxpZ25mX2RhdGEpOwogCQlpZiAocmV0ID09IDApCi0JCQlicmVhazsKKwkJCXJl dHVybiAwOworCX0KKworCWlmIChzdGFydCAhPSAwKSB7CisJCXN0YXJ0ID0gMDsKKwkJZ290byBh Z2FpbjsKIAl9CisKIAlyZXR1cm4gcmV0OwogfQogCg== --e89a8ff1c3d0f592f804c0e478e2-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/