powerpc/eeh: Introduce EEH device
authorGavin Shan <shangw@linux.vnet.ibm.com>
Mon, 27 Feb 2012 20:04:04 +0000 (20:04 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 9 Mar 2012 00:39:29 +0000 (11:39 +1100)
commiteb740b5f3e6559a8f1c22e2505914d07f9632881
tree6e463d4ba852359d82b33a61040e240430280fa6
parentdef9d83da4f8587dbad5ea57c57d91e53a51006a
powerpc/eeh: Introduce EEH device

Original EEH implementation depends on struct pci_dn heavily. However,
EEH shouldn't depend on that actually because EEH needn't share much
information with other PCI components. That's to say, EEH should have
worked independently.

The patch introduces struct eeh_dev so that EEH core components needn't
be working based on struct pci_dn in future. Also, struct pci_dn, struct
eeh_dev instances are created in dynamic fasion and the binding with EEH
device, OF node, PCI device is implemented as well.

The EEH devices are created after PHBs are detected and initialized, but
PCI emunation hasn't started yet. Apart from that, PHB might be created
dynamically through DLPAR component and the EEH devices should be creatd
as well. Another case might be OF node is created dynamically by DR
(Dynamic Reconfiguration), which has been defined by PAPR. For those OF
nodes created by DR, EEH devices should be also created accordingly. The
binding between EEH device and OF node is done while the EEH device is
initially created.

The binding between EEH device and PCI device should be done after PCI
emunation is done. Besides, PCI hotplug also needs the binding so that
the EEH devices could be traced from the newly coming PCI buses or PCI
devices.

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/include/asm/device.h
arch/powerpc/include/asm/eeh.h
arch/powerpc/kernel/of_platform.c
arch/powerpc/kernel/rtas_pci.c
arch/powerpc/platforms/pseries/Makefile
arch/powerpc/platforms/pseries/eeh_dev.c [new file with mode: 0644]
arch/powerpc/platforms/pseries/pci_dlpar.c
arch/powerpc/platforms/pseries/setup.c
include/linux/of.h
include/linux/pci.h