powerpc/pci: Split pcibios_fixup_bus() into bus setup and device setup
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 27 Oct 2008 19:48:37 +0000 (19:48 +0000)
committerPaul Mackerras <paulus@samba.org>
Wed, 5 Nov 2008 22:22:37 +0000 (09:22 +1100)
commit8b8da35804bb89eee23f9bcd5638e1f754bd4c91
tree8ec1ba6ef03c88da5c37eec4825fff6524358b37
parentab56ced9c57b66862c687f3158045d15133f02d6
powerpc/pci: Split pcibios_fixup_bus() into bus setup and device setup

Currently, our PCI code uses the pcibios_fixup_bus() callback, which
is called by the generic code when probing PCI buses, for two
different things.

One is to set up things related to the bus itself, such as reading
bridge resources for P2P bridges, fixing them up, or setting up the
iommu's associated with bridges on some platforms.

The other is some setup for each individual device under that bridge,
mostly setting up DMA mappings and interrupts.

The problem is that this approach doesn't work well with PCI hotplug
when an existing bus is re-probed for new children.  We fix this
problem by splitting pcibios_fixup_bus into two routines:

pcibios_setup_bus_self() is now called to setup the bus itself

pcibios_setup_bus_devices() is now called to setup devices

pcibios_fixup_bus() is then modified to call these two after reading the
bridge bases, and the OF based PCI probe is modified to avoid calling
into the first one when rescanning an existing bridge.

[paulus@samba.org - fixed eeh.h for 32-bit compile now that pci-common.c
is including it unconditionally.]

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/include/asm/eeh.h
arch/powerpc/include/asm/pci.h
arch/powerpc/kernel/pci-common.c
arch/powerpc/kernel/pci_64.c