summaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorNiklas Schnelle <schnelle@linux.ibm.com>2021-03-05 14:32:02 +0100
committerHeiko Carstens <hca@linux.ibm.com>2021-03-22 11:36:04 +0100
commita9045c2210448473a321a8bf266541e5644aaae2 (patch)
treea7645a83675c8134232e00fe5f51f154f5b9232e /arch/s390
parentf6576a1b4896b984dce0e8393efeba68cc2b96c8 (diff)
downloadlinux-a9045c2210448473a321a8bf266541e5644aaae2.tar.bz2
s390/pci: deconfigure device on release
When zpci_release_device() is called on a zPCI function that is still configured it would not be deconfigured. Until now this hasn't caused any problems because zpci_zdev_put() is only ever called for devices in Standby or Reserved. Fix it by adding sclp_pci_deconfigure() to the switch when in Configured state. Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com> Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/pci/pci.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c
index 053113bcad60..5d6b838c0f22 100644
--- a/arch/s390/pci/pci.c
+++ b/arch/s390/pci/pci.c
@@ -782,6 +782,7 @@ error:
void zpci_release_device(struct kref *kref)
{
struct zpci_dev *zdev = container_of(kref, struct zpci_dev, kref);
+ int ret;
if (zdev->zbus->bus)
zpci_remove_device(zdev, false);
@@ -790,6 +791,10 @@ void zpci_release_device(struct kref *kref)
zpci_disable_device(zdev);
switch (zdev->state) {
+ case ZPCI_FN_STATE_CONFIGURED:
+ ret = sclp_pci_deconfigure(zdev->fid);
+ zpci_dbg(3, "deconf fid:%x, rc:%d\n", zdev->fid, ret);
+ fallthrough;
case ZPCI_FN_STATE_STANDBY:
if (zdev->has_hp_slot)
zpci_exit_slot(zdev);