[Skiboot] [PATCH RFC 0/6] core/pci: Sync VFs and the changes of bdfns between the firmware and the OS

Sergey Miroshnichenko s.miroshnichenko at yadro.com
Sat Mar 2 01:30:32 AEDT 2019


An OS may re-enumerate the PCIe tree during boot or after hot-plugging a
bridge, but this leads to de-sync of the cached and actual BDF addresses.

This patchset tracks the changes in bus numbers and updates the cached
topology (a tree consisting of struct pci_device nodes) correspondingly,
including allocation of newly discovered devices and activated virtual
functions within SR-IOV.

Tested on POWER8 PowerNV+PHB3 ppc64le (our Vesnin server) with:
 * Linux kernel 5.0-rc6;
   - the pciehp driver active;
   - the pnv_php driver disabled;
   - Extra pacthes applied: "powerpc/powernv/pci: Make hotplug
   - self-sufficient, independent of FW and DT";
   - surprise hotplug of an NVME disk works;
   - controlled hotplug of a network card with SR-IOV works;
   - activating of SR-IOV on a network card works;
   - [with extra patches] manually initiated (via sysfs) rescan has found
     and turned on a hotplugged bridge;

 * Ubuntu's 4.15.0-45-generic kernel from 18.04.2 LTS:
   - boots and works just fine.

Sergey Miroshnichenko (6):
  core/pci: Add functions to find accessible devices by bdfn
  core/pci: Make the pci_scan_one() function public
  core/pci: Create the struct pci_device nodes automatically
  pci-iov: Fix device allocation for VFs
  pci-iov: Set parent of VFs to the bridge's downstream instead of PF
  core/pci: Hook up the writes to PRIMARY/SECONDARY/SUBORDINATE_BUS
    registers

 core/pci-iov.c  | 27 ++++++++------
 core/pci-opal.c | 93 ++++++++++++++++++++++++++++++++++++++++++++++++-
 core/pci.c      | 87 +++++++++++++++++++++++++++++++++++++++++++--
 include/pci.h   |  4 +++
 4 files changed, 197 insertions(+), 14 deletions(-)

-- 
2.20.1



More information about the Skiboot mailing list