]> Git Repo - linux.git/commitdiff
s390/pci: fix hot-plug of PCI function missing bus
authorNiklas Schnelle <[email protected]>
Mon, 2 Nov 2020 10:33:04 +0000 (11:33 +0100)
committerHeiko Carstens <[email protected]>
Tue, 3 Nov 2020 14:12:16 +0000 (15:12 +0100)
Under some circumstances in particular with "Reconfigure I/O Path"
a zPCI function may first appear in Standby through a PCI event with
PEC 0x0302 which initially makes it visible to the zPCI subsystem,
Only after that is it configured with a zPCI event  with PEC 0x0301.
If the zbus is still missing a PCI function zero (devfn == 0) when the
PCI event 0x0301 is handled zdev->zbus->bus is still NULL and gets
dereferenced in common code.
Check for this case and enable but don't scan the zPCI function.
This matches what would happen if we immediately got the 0x0301
configuration request or the function was included in CLP List PCI.
In all cases the PCI functions with devfn != 0 will be scanned once
function 0 appears.

Fixes: 3047766bc6ec ("s390/pci: fix enabling a reserved PCI function")
Cc: <[email protected]> # 5.8
Signed-off-by: Niklas Schnelle <[email protected]>
Acked-by: Pierre Morel <[email protected]>
Signed-off-by: Heiko Carstens <[email protected]>
arch/s390/pci/pci_event.c

index d33f21545dfdb82bff668c8092a2a8e58ec069fc..9a6bae503fe61c0b54866bdf1c3d6f5459c44194 100644 (file)
@@ -101,6 +101,10 @@ static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf)
                if (ret)
                        break;
 
+               /* the PCI function will be scanned once function 0 appears */
+               if (!zdev->zbus->bus)
+                       break;
+
                pdev = pci_scan_single_device(zdev->zbus->bus, zdev->devfn);
                if (!pdev)
                        break;
This page took 0.059333 seconds and 4 git commands to generate.