Allow switching from the pnv_php module to the standard pciehp driver for PowerNV, if the platform supports it: it can be a server working on top of the skiboot with the [1] patchset applied.
Add the ability to discover hot-added devices which weren't added to the Device Tree (by the pnv_php via an explicit OPAL call when a hotplug event was intercepted) by direct access to the bus. Sync the changes in PCIe topology (bus numbers and PEs) with the skiboot. Tested on POWER8 PowerNV+PHB3 ppc64le (our Vesnin server) with: - the pciehp driver active; - the pnv_php driver disabled; - the "pci=pcie_bus_peer2peer,realloc" kernel command line argument; - controlled hotplug of a network card with SR-IOV works; - activating of SR-IOV on a network card works; - [with extra patches for movable BARs and bus numbers] manually initiated (via sysfs) rescan has found and turned on a hotplugged bridge. [1] https://lists.ozlabs.org/pipermail/skiboot/2019-August/015140.html [Skiboot] [PATCH v3 0/5] core/pci: Track changes of topology by an OS Change since v5: - Activates on "ibm,supported-movable-bdfs" property in DT from skiboot instead of the "pci=realloc" flag; - Removed the code refactoring patches - will send them separately. Changes since v4: - Fixed failing build when EEH is disabled in a kernel config; - Unfreeze the bus on EEH_IO_ERROR_VALUE(size), not only 0xffffffff; - Replaced the 0xff magic constant with phb->ioda.reserved_pe_idx; - Renamed create_pdn() -> pci_create_pdn_from_dev(); - Renamed add_one_dev_pci_data(..., vf_index, ...) -> pci_alloc_pdn(); - Renamed add_dev_pci_data() -> pci_create_vf_pdns(); - Renamed remove_dev_pci_data() -> pci_destroy_vf_pdns(); - Removed the patch fixing uninitialized IOMMU group - now it is fixed in commit 8f5b27347e88 ("powerpc/powernv/sriov: Register IOMMU groups for VFs") Changes since v3: - Subject changed; - Don't disable EEH during rescan anymore - instead just unfreeze the target buses deliberately; - Add synchronization with the firmware when changing the PCIe topology; - Fixed for VFs; - Code cleanup. Changes since v2: - Don't reassign bus numbers on PowerNV by default (to retain the default behavior), but only when pci=realloc is passed; - Less code affected; - pci_add_device_node_info is refactored with add_one_dev_pci_data; - Minor code cleanup. Changes since v1: - Fixed build for ppc64le and ppc64be when CONFIG_PCI_IOV is disabled; - Fixed build for ppc64e when CONFIG_EEH is disabled; - Fixed code style warnings. Sergey Miroshnichenko (5): powerpc/pci: Access PCI config space directly w/o pci_dn powerpc/powernv/pci: Suppress an EEH error when reading an empty slot powerpc/pci: Create pci_dn on demand powerpc/powernv/pci: Hook up the writes to PCI_SECONDARY_BUS register powerpc/pci: Enable assigning bus numbers instead of reading them from DT arch/powerpc/include/asm/ppc-pci.h | 1 + arch/powerpc/kernel/pci_dn.c | 95 +++++++-- arch/powerpc/kernel/rtas_pci.c | 97 ++++++--- arch/powerpc/platforms/powernv/eeh-powernv.c | 2 +- arch/powerpc/platforms/powernv/pci.c | 205 +++++++++++++++++-- 5 files changed, 331 insertions(+), 69 deletions(-) -- 2.21.0