[Skiboot] [PATCH RESEND v3 0/5] core/pci: Track changes of topology by an OS

Sergey Miroshnichenko s.miroshnichenko at yadro.com
Fri Oct 25 05:02:54 AEDT 2019


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

Track the changes in bus numbering and update the cached topology (a tree
consisting of struct pci_device nodes) correspondingly, including PEs.

Append the cached topology when reading a config space reveals a hot-added
device, with no need for an explicit OPAL call for that.

Tested on POWER8 PowerNV+PHB3 ppc64le (Vesnin platform) and Linux kernel
5.4.0-rc4.

Changes since v2:
 - Removed handling VFs, as skiboot doesn't track them anymore;
 - Use macros for accessing PCI BDF bits.

Changes since v1:
 - Fixed comparing 32-bit constant with uint16_t and uint8_t.

Sergey Miroshnichenko (5):
  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
  core/pci: Hook up the writes to PRIMARY/SECONDARY/SUBORDINATE_BUS
    registers
  core/pci: Indicate support for PCI re-enumeration

 core/pci-opal.c | 101 +++++++++++++++++++++++++++++++++++++++++++++---
 core/pci.c      |  88 ++++++++++++++++++++++++++++++++++++++++-
 include/pci.h   |   4 ++
 3 files changed, 186 insertions(+), 7 deletions(-)

-- 
2.23.0



More information about the Skiboot mailing list