summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorFarhan Ali <alifm@linux.ibm.com>2026-08-05 09:55:15 -0700
committerBjorn Helgaas <bhelgaas@google.com>2026-08-12 17:12:48 -0500
commitdcc5bec09e23bbc4f9de055a11fce9937244f2c8 (patch)
tree0b4f03a284723f9ec3e534661346444e84a79784 /scripts
parentc243e6c470c4695965cc8287767925bc1d9a7867 (diff)
downloadlinux-dcc5bec09e23bbc4f9de055a11fce9937244f2c8.tar.gz
linux-dcc5bec09e23bbc4f9de055a11fce9937244f2c8.zip
PCI: Allow per function PCI slots to fix slot reset on s390
On s390 systems, which use a machine level hypervisor, PCI devices are always accessed through a form of PCI pass-through which fundamentally operates on a per PCI function granularity. This is also reflected in the s390 PCI hotplug driver which creates hotplug slots for individual PCI functions. Its reset_slot() function, which is a wrapper for zpci_hot_reset_device(), thus also resets individual functions. Currently, the pci_create_slot() assigns the same pci_slot object to multifunction devices. This approach worked fine on s390 systems that only exposed virtual functions as individual PCI domains to the operating system. Since commit 44510d6fa0c0 ("s390/pci: Handling multifunctions") s390 supports exposing the topology of multifunction PCI devices by grouping them in a shared PCI domain. This creates a problem when resetting a function through the hotplug driver's slot_reset() interface. When attempting to reset a function through the hotplug driver, the shared slot assignment causes the wrong function to be reset instead of the intended one. It also leaks memory as we do create a pci_slot object for the function, but don't correctly free it in pci_slot_release(). Add a flag for struct pci_slot to allow per function PCI slots for functions managed through a hypervisor, which exposes individual PCI functions while retaining the topology. Since we can use all 8 bits for slot 'number' (for ARI devices), change slot 'number' u16 to account for special values PCI_SLOT_PLACEHOLDER and PCI_SLOT_ALL_DEVICES. Fixes: 44510d6fa0c0 ("s390/pci: Handling multifunctions") Suggested-by: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Farhan Ali <alifm@linux.ibm.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Niklas Schnelle <schnelle@linux.ibm.com> Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20260805165518.794-3-alifm@linux.ibm.com
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions