powerpc/eeh: powerpc/eeh: Support error recovery for VF PE
authorWei Yang <weiyang@linux.vnet.ibm.com>
Thu, 3 Mar 2016 23:53:11 +0000 (10:53 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 8 Mar 2016 22:58:23 +0000 (09:58 +1100)
commit67086e32b56481531ab1292b284e074b1a8d764c
tree67012baf5d2b62c7cc1d0f05600bee2c30f29c9b
parent0dc2830e0a48d520c7db7cc55dbbd0edefac02f5
powerpc/eeh: powerpc/eeh: Support error recovery for VF PE

PFs are enumerated on PCI bus, while VFs are created by PF's driver.

In EEH recovery, it has two cases:
1. Device and driver is EEH aware, error handlers are called.
2. Device and driver is not EEH aware, un-plug the device and plug it again
by enumerating it.

The special thing happens on the second case. For a PF, we could use the
original pci core to enumerate the bus, while for VF we need to record the
VFs which aer un-plugged then plug it again.

Also The patch caches the VF index in pci_dn, which can be used to
calculate VF's bus, device and function number. Those information helps to
locate the VF's PCI device instance when doing hotplug during EEH recovery
if necessary.

Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
Acked-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/eeh.h
arch/powerpc/include/asm/pci-bridge.h
arch/powerpc/kernel/eeh.c
arch/powerpc/kernel/eeh_dev.c
arch/powerpc/kernel/eeh_driver.c
arch/powerpc/kernel/pci_dn.c