s390/pci: narrow scope of zpci_configure_device()
authorNiklas Schnelle <schnelle@linux.ibm.com>
Fri, 26 Mar 2021 12:58:48 +0000 (13:58 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Mon, 12 Apr 2021 10:46:42 +0000 (12:46 +0200)
commit61311e32892b008886478bdba4ce2a34f4d938f8
treeb8e88fbcf8422e6347d0c33d6a83f755dc425f1d
parent14c87ba8123abe6b707d04e1711eef90653567f2
s390/pci: narrow scope of zpci_configure_device()

Currently zpci_configure_device() can be called on a zPCI function in
two completely different states. Either the underlying zPCI function has
already been configured by the platform and we are only doing the
scanning to get it usable by Linux drivers. Or the underlying function
is in Standby and we first do an SCLP to get it configured. This makes
zpci_configure_device() harder to reason about. Since calling
zpci_configure_device() on a function in Standby only happens in
enable_slot() simply pull out the SCLP call and setting of zdev->state
and thus call zpci_configure_device() under the same circumstances as
in the event handling code.

Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Reviewed-by: Pierre Morel <pmorel@linux.ibm.com>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/pci/pci.c
drivers/pci/hotplug/s390_pci_hpc.c