]> git.baikalelectronics.ru Git - kernel.git/commit
s390/pci: fix hot-plug of PCI function missing bus
authorNiklas Schnelle <schnelle@linux.ibm.com>
Mon, 2 Nov 2020 10:33:04 +0000 (11:33 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Tue, 3 Nov 2020 14:12:16 +0000 (15:12 +0100)
commit48b4f971e1a789dfb6805fc356fef80f8c54294c
treec3e72a576b1b27d5ffd7aeec42785f32bc15cd95
parent2b1ca1359b0c31407aef0e20a5ac30ef0c2b82ac
s390/pci: fix hot-plug of PCI function missing bus

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: 10856f0b4eeb ("s390/pci: fix enabling a reserved PCI function")
Cc: <stable@vger.kernel.org> # 5.8
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Acked-by: Pierre Morel <pmorel@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/pci/pci_event.c