summaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug
diff options
context:
space:
mode:
authorNiklas Schnelle <schnelle@linux.ibm.com>2021-03-26 13:58:48 +0100
committerHeiko Carstens <hca@linux.ibm.com>2021-04-12 12:46:42 +0200
commit61311e32892b008886478bdba4ce2a34f4d938f8 (patch)
treeb8e88fbcf8422e6347d0c33d6a83f755dc425f1d /drivers/pci/hotplug
parent14c87ba8123abe6b707d04e1711eef90653567f2 (diff)
downloadlinux-61311e32892b008886478bdba4ce2a34f4d938f8.tar.bz2
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>
Diffstat (limited to 'drivers/pci/hotplug')
-rw-r--r--drivers/pci/hotplug/s390_pci_hpc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/pci/hotplug/s390_pci_hpc.c b/drivers/pci/hotplug/s390_pci_hpc.c
index 154532663a70..f8f056be71b7 100644
--- a/drivers/pci/hotplug/s390_pci_hpc.c
+++ b/drivers/pci/hotplug/s390_pci_hpc.c
@@ -24,10 +24,17 @@ static int enable_slot(struct hotplug_slot *hotplug_slot)
{
struct zpci_dev *zdev = container_of(hotplug_slot, struct zpci_dev,
hotplug_slot);
+ int rc;
if (zdev->state != ZPCI_FN_STATE_STANDBY)
return -EIO;
+ rc = sclp_pci_configure(zdev->fid);
+ zpci_dbg(3, "conf fid:%x, rc:%d\n", zdev->fid, rc);
+ if (rc)
+ return rc;
+ zdev->state = ZPCI_FN_STATE_CONFIGURED;
+
return zpci_configure_device(zdev, zdev->fh);
}