From: Andrew Morton <akpm@osdl.org>
To: "Yinghai Lu" <yinghai.lu@amd.com>
Cc: "Greg KH" <gregkh@suse.de>, "Andi Kleen" <ak@suse.de>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [Patch] PCI: check szhi when sz is 0 for 64 bit pref mem
Date: Mon, 6 Nov 2006 14:04:32 -0800 [thread overview]
Message-ID: <20061106140432.44d3c19f.akpm@osdl.org> (raw)
In-Reply-To: <86802c440611032127u33442a33ufc4cf3b11e9b8c7a@mail.gmail.com>
On Fri, 3 Nov 2006 21:27:35 -0800
"Yinghai Lu" <yinghai.lu@amd.com> wrote:
> For co-prcessor with mem installed, the ram will be treated to pref mem.
What is "pref mem"?
> Under 64bit kernel, when 64bit pref mem size is above 4G, sz from pci_size in low bits, will get 0,
> at this point, we need to check szhi too. Otherwise the pre-set value by firmware can not be read
> to resrource struct, it will skip that resource, and try to hi 32 bit as another 32bit resource.
>
> Cc: Myles Watson <myles@mouselemur.cs.byu.edu>
> Signed-off-by: Yinghai Lu <yinghai.lu@amd.com>
>
>
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -165,8 +165,13 @@ static void pci_read_bases(struct pci_de
> l = 0;
> if ((l & PCI_BASE_ADDRESS_SPACE) == PCI_BASE_ADDRESS_SPACE_MEMORY) {
> sz = pci_size(l, sz, (u32)PCI_BASE_ADDRESS_MEM_MASK);
> - if (!sz)
> - continue;
> + /* for 64bit pref, sz could be 0, if the real size is bigger than 4G,
> + so need to check szhi for it
> + */
> + if ((l & (PCI_BASE_ADDRESS_SPACE | PCI_BASE_ADDRESS_MEM_TYPE_MASK))
> + != (PCI_BASE_ADDRESS_SPACE_MEMORY | PCI_BASE_ADDRESS_MEM_TYPE_64))
> + if (!sz)
> + continue;
> res->start = l & PCI_BASE_ADDRESS_MEM_MASK;
> res->flags |= l & ~PCI_BASE_ADDRESS_MEM_MASK;
> } else {
> @@ -188,6 +193,12 @@ static void pci_read_bases(struct pci_de
> szhi = pci_size(lhi, szhi, 0xffffffff);
> next++;
> #if BITS_PER_LONG == 64
> + if( !sz && !szhi) {
> + res->start = 0;
> + res->end = 0;
> + res->flags = 0;
> + continue;
> + }
> res->start |= ((unsigned long) lhi) << 32;
> res->end = res->start + sz;
> if (szhi) {
I don't really understand what this patch does.
We have a PCI device with a 64-bit BAR and the size is also 64-bit and is
larger than 4G, yes?
But the code appears to already be attempting to handle such devices.
Confused.
next prev parent reply other threads:[~2006-11-06 22:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-04 5:27 [Patch] PCI: check szhi when sz is 0 for 64 bit pref mem Yinghai Lu
2006-11-06 22:04 ` Andrew Morton [this message]
2006-11-08 18:19 ` Eric W. Biederman
2006-11-08 19:10 ` Andrew Morton
-- strict thread matches above, loose matches on Subject: below --
2006-11-06 22:15 Lu, Yinghai
2006-11-07 0:04 ` Andrew Morton
2006-11-07 4:35 ` Yinghai Lu
2006-11-08 19:15 Lu, Yinghai
2006-11-10 0:50 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061106140432.44d3c19f.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=ak@suse.de \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=yinghai.lu@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox