From: Arnd Bergmann <arnd@arndb.de>
To: linuxppc64-dev@ozlabs.org
Cc: Matthew Wilcox <matthew@wil.cx>, Brian King <brking@us.ibm.com>,
linux-arch@vger.kernel.org, Greg KH <greg@kroah.com>,
linux-kernel@vger.kernel.org,
Christoph Hellwig <hch@infradead.org>,
linux-pci@vger.kernel.org
Subject: Re: pci: Arch hook to determine config space size
Date: Mon, 31 Jan 2005 21:51:04 +0100 [thread overview]
Message-ID: <200501312151.05323.arnd@arndb.de> (raw)
In-Reply-To: <20050131192955.GJ31145@parcelfarce.linux.theplanet.co.uk>
[-- Attachment #1: Type: text/plain, Size: 1656 bytes --]
On Maandag 31 Januar 2005 20:29, Matthew Wilcox wrote:
> Thanks for copying linux-pci. I hate this patch.
>
> Basically, ppc64's config ops are broken and need to check the offset
> being read.
To make things worse, simply allowing the larger config space will
silently access the wrong device. The least that needs to be done
is to pass the correct address to the firmware.
This patch should do the right thing, though I don't have any PCIe
card to test with.
Note that at least for the rtas pci config access, the bus/devfn
values come from the device tree, which makes it somewhat harder
to screw them up, and rtas ought to check for obviously wrong
addresses as well.
Signed-off-by: Arnd Bergmann <arndb@de.ibm.com>
--- linux-mm.orig/arch/ppc64/kernel/pSeries_pci.c 2005-01-28 07:21:15.000000000 -0500
+++ linux-mm/arch/ppc64/kernel/pSeries_pci.c 2005-01-31 15:56:10.244983464 -0500
@@ -63,7 +63,8 @@
if (where & (size - 1))
return PCIBIOS_BAD_REGISTER_NUMBER;
- addr = (dn->busno << 16) | (dn->devfn << 8) | where;
+ addr = ((where & 0xf00) << 20) | (dn->busno << 16)
+ | (dn->devfn << 8) | (where & 0x0ff);
buid = dn->phb->buid;
if (buid) {
ret = rtas_call(ibm_read_pci_config, 4, 2, &returnval,
@@ -111,7 +112,8 @@
if (where & (size - 1))
return PCIBIOS_BAD_REGISTER_NUMBER;
- addr = (dn->busno << 16) | (dn->devfn << 8) | where;
+ addr = ((where & 0xf00) << 20) | (dn->busno << 16)
+ | (dn->devfn << 8) | (where & 0x0ff);
buid = dn->phb->buid;
if (buid) {
ret = rtas_call(ibm_write_pci_config, 5, 1, NULL, addr, buid >> 32, buid & 0xffffffff, size, (ulong) val);
[-- Attachment #2: signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2005-01-31 20:51 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200501281456.j0SEuI12020454@d01av01.pok.ibm.com>
[not found] ` <20050128185234.GB21760@infradead.org>
[not found] ` <20050129040647.GA6261@kroah.com>
2005-01-31 19:10 ` pci: Arch hook to determine config space size Brian King
2005-01-31 19:15 ` Greg KH
2005-01-31 19:29 ` Matthew Wilcox
2005-01-31 20:51 ` Arnd Bergmann [this message]
2005-01-31 21:35 ` Brian King
2005-01-31 21:56 ` Arnd Bergmann
2005-01-31 22:13 ` Greg KH
2005-01-31 22:43 ` Brian King
2005-02-01 3:15 ` Benjamin Herrenschmidt
2005-02-01 4:52 ` Brian King
2005-02-01 4:57 ` Benjamin Herrenschmidt
2005-02-02 10:05 ` Arnd Bergmann
2005-02-03 0:23 ` Benjamin Herrenschmidt
2005-02-01 12:32 ` Matthew Wilcox
2005-02-01 20:16 ` Brian King
2005-01-31 19:40 ` Brian King
2005-02-01 7:46 ` Grant Grundler
2005-02-01 15:23 ` Brian King
2005-01-31 23:22 arndb
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=200501312151.05323.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=brking@us.ibm.com \
--cc=greg@kroah.com \
--cc=hch@infradead.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linuxppc64-dev@ozlabs.org \
--cc=matthew@wil.cx \
/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