This series of patches supports PCI surprise hotplug on PowerNV platform. Without the corresponding skiboot patches, this feature won't be enabled and workable.
* The skiboot patches can be found in below link (PATCH[01/16): https://patchwork.ozlabs.org/project/skiboot/list/?submitter=63923 * This newly added functionality depends on skiboot's changes. However, the functionality is disabled simply when skiboot doesn't support it. For one specific slot, property "ibm,slot-surprise-pluggable" of the slot's device node is set to 1 when surprise hotplug is claimed by skiboot. * The interrupts because of presence and link state change are enabled in order to support PCI surprise hotplug. The surprise hotplug events are queued to the PCI slot and they're picked up for further processing in serialized fashion. The surprise and managed hotplug share same code flow except: the affected PEs are put into frozen state to avoid unexpected EEH error reporting in surprise hot remove path. PATCH[1/5] and PATCH[2/5] allows to freeze PEs to avoid unexpected EEH error reporting in PCI surprise hot remove path. PATCH[3/5] clears PE's frozen state on initializing it because the PE might have been put into frozen state in last PCI surprise hot remove. PATCH[4/5] removes likely() and unlikely() in pnv_php.c as they are not too useful. PATCH[5/5] supports PCI surprise hotplug for PowerNV PCI hotplug driver. Changelog ========= v2: * Add one patch to remove likely() and unlikely() in pnv_php.c. * Remove likely() and unlikely() in PATCH[v1 4/4]. * The event isn't pre-allocated. It's always allocated from slab in the interrupt handler. The removed PE is put into frozen state before the event is allocated. Gavin Shan (5): powerpc/eeh: Allow to freeze PE in eeh_pe_set_option() powerpc/eeh: Export eeh_pe_state_mark() powerpc/powernv: Unfreeze PE on allocation drivers/pci/hotplug: Remove likely() and unlikely() in powernv driver drivers/pci/hotplug: Support surprise hotplug in powernv driver arch/powerpc/include/asm/pnv-pci.h | 2 + arch/powerpc/kernel/eeh.c | 1 + arch/powerpc/kernel/eeh_pe.c | 1 + arch/powerpc/platforms/powernv/pci-ioda.c | 12 ++ drivers/pci/hotplug/pnv_php.c | 268 ++++++++++++++++++++++++++---- 5 files changed, 256 insertions(+), 28 deletions(-) -- 2.1.0