Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758319Ab2EYSj2 (ORCPT ); Fri, 25 May 2012 14:39:28 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:59067 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752948Ab2EYSj1 (ORCPT ); Fri, 25 May 2012 14:39:27 -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> Date: Fri, 25 May 2012 11:39:26 -0700 X-Google-Sender-Auth: 8uwQc1rwUpkMiIvr0M7abcwugRA 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=047d7b162fd718665c04c0e0b0cf Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4076 Lines: 77 --047d7b162fd718665c04c0e0b0cf Content-Type: text/plain; charset=ISO-8859-1 On Fri, May 25, 2012 at 10:53 AM, Yinghai Lu wrote: >> I don't really like the dependency on PCIBIOS_MAX_MEM_32 + 1ULL >> overflowing to zero -- that means the reader has to know what the >> value of PCIBIOS_MAX_MEM_32 is, and things would break in non-obvious >> ways if we changed it. >> please check if attached one is more clear. make max and bottom is only related to _MEM and not default one. - if (!(res->flags & IORESOURCE_MEM_64)) - max = PCIBIOS_MAX_MEM_32; + if (res->flags & IORESOURCE_MEM) { + if (!(res->flags & IORESOURCE_MEM_64)) + max = PCIBIOS_MAX_MEM_32; + else if (PCIBIOS_MAX_MEM_32 != -1) + bottom = (resource_size_t)(1ULL<<32); + } will still not affect to other arches. Thanks Yinghai --047d7b162fd718665c04c0e0b0cf Content-Type: application/octet-stream; name="allocate_high_at_first.patch" Content-Disposition: attachment; filename="allocate_high_at_first.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_h2nlec0k0 U3ViamVjdDogW1BBVENIXSBQQ0k6IFRyeSB0byBhbGxvY2F0ZSBtZW02NCBhYm92ZSA0RyBhdCBm aXJzdAoKYW5kIHdpbGwgZmFsbCBiYWNrIHRvIGJlbG93IDRnIGlmIGl0IGNhbiBub3QgZmluZCBh bnkgYWJvdmUgNGcuCgpvbmx5IHg4NiBoYXZlIFBDSUJJT1NfTUFYX01FTV8zMiBzZXQgdG8gMHhm ZmZmZmZmZi4KaXQgd2lsbCBvbmx5IGFmZmVjdCB4ODZfNjQgYW5kIDMyYml0IHdpdGggcmVzb3Vy Y2Vfc2l6ZV90IDY0Yml0IHN1cHBvcnQuCm9ubHkgdGhhdCBjYXNlIGJvdHRvbSBpcyBzZXQgdG8g NGcgZm9yIGZpcnN0IHRyeS4KCng4NiAzMmJpdCB3aXRob3V0IFg4Nl9QQUUgc3VwcG9ydCB3aWxs IGhhdmUgYm90dG9tIHNldCB0byAwLCBiZWN1YXNlCnJlc291cmNlX3NpemVfdCBpcyAzMmJpdC4K CkFsc28gZm9yIDMyYml0IHdpdGggcmVzb3VyY2Vfc2l6ZV90IDY0Yml0IGtlcm5lbCBvbiBtYWNo aW5lIHdpdGggcGFlIHN1cHBvcnQKd2UgYXJlIHNhZmUgYmVjYXVzZSBpb21lbV9yZXNvdXJjZSBp cyBsaW1pdGVkIHRvIDMyYml0IGFjY29yZGluZyB0bwp4ODZfcGh5c19iaXRzLgoKLXYyOiB1cGRh dGUgYm90dG9tIGFzc2lnbmluZyB0byBtYWtlIGl0IGNsZWFyIGZvciBub24tcGFlIHN1cHBvcnQg bWFjaGluZS4KClNpZ25lZC1vZmYtYnk6IFlpbmdoYWkgTHUgPHlpbmdoYWlAa2VybmVsLm9yZz4K Ci0tLQogZHJpdmVycy9wY2kvYnVzLmMgfCAgIDIwICsrKysrKysr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XNvdXJjZShidXMsIHIsIGkpIHsKIAkJaWYgKCFyKQogCQkJY29udGludWU7CkBAIC0xNDUsMTIg KzE1MSwxOCBAQCBwY2lfYnVzX2FsbG9jX3Jlc291cmNlKHN0cnVjdCBwY2lfYnVzICpiCiAKIAkJ LyogT2ssIHRyeSBpdCBvdXQuLiAqLwogCQlyZXQgPSBhbGxvY2F0ZV9yZXNvdXJjZShyLCByZXMs IHNpemUsCi0JCQkJCXItPnN0YXJ0ID8gOiBtaW4sCisJCQkJCW1heChib3R0b20sIHItPnN0YXJ0 ID8gOiBtaW4pLAogCQkJCQltYXgsIGFsaWduLAogCQkJCQlhbGlnbmYsIGFsaWduZl9kYXRhKTsK IAkJaWYgKHJldCA9PSAwKQotCQkJYnJlYWs7CisJCQlyZXR1cm4gMDsKKwl9CisKKwlpZiAoYm90 dG9tICE9IDApIHsKKwkJYm90dG9tID0gMDsKKwkJZ290byBhZ2FpbjsKIAl9CisKIAlyZXR1cm4g cmV0OwogfQogCg== --047d7b162fd718665c04c0e0b0cf-- -- 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/