[PATCH] pci_dev to device_node fix

Benjamin Herrenschmidt benh at kernel.crashing.org
Fri Mar 5 10:56:35 EST 2004


On Fri, 2004-03-05 at 09:01, Jake Moilanen wrote:
> On the JS20's there was a recent FW change where it moved one of the
> buses to busno 0.  There is also a bridge w/ a devfn of 0 on that bus.
> While trying probing behind that bridge we try looking up the
> device_node using the busno and devfn to read config space.  When we
> call pci_device_to_OF_node() we'll pass in the devfn and busno only to
> compare with to find the matching device_node.  Instead of getting the
> bridge's device_node, we get the PHB's device_node, because there is an
> assumption when setting up the PHB in update_dn_pci_info() that the
> PHB's devfn is 0.  This will cause us to recursively go down the first
> bridge and we actually die when trying to make duplicate entries in
> sysfs.
>
> This patch adds "is_phb" property to the device_node.  Since we are
> trying to find a device_node from a pci_dev, we shouldn't worry about
> PHB's since PHB's are stored in pci_controllers.  This change will allow
> us to correctly get the device_node.

Hi Jake !

I don't like the workaround, this isn't 2.4, we are trying to do
things cleanly in 2.6 ;)

Why can't we fix the assumption that devfn 0 == phb in the first
place ? That is, what piece of code relies on it and what would it
cost to fix it ?

Ben


** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list