summaryrefslogtreecommitdiffstats
path: root/arch/s390/pci
diff options
context:
space:
mode:
authorGerd Bayer <gbayer@linux.ibm.com>2023-11-10 12:06:42 +0100
committerHeiko Carstens <hca@linux.ibm.com>2024-02-20 14:37:32 +0100
commit6ee600bfbe0f818ffb7748d99e9b0c89d0d9f02a (patch)
tree246b5427daa8dd7d5845c4b0f4132a29940b093b /arch/s390/pci
parentbcb5d6c769039c8358a2359e7c3ea5d97ce93108 (diff)
downloadlinux-6ee600bfbe0f818ffb7748d99e9b0c89d0d9f02a.tar.gz
linux-6ee600bfbe0f818ffb7748d99e9b0c89d0d9f02a.tar.bz2
linux-6ee600bfbe0f818ffb7748d99e9b0c89d0d9f02a.zip
s390/pci: remove hotplug slot when releasing the device
Centralize the removal so all paths are covered and the hotplug slot will remain active until the device is really destroyed. Signed-off-by: Gerd Bayer <gbayer@linux.ibm.com> Reviewed-by: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch/s390/pci')
-rw-r--r--arch/s390/pci/pci.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c
index 17267f659d22..c87b8aff5285 100644
--- a/arch/s390/pci/pci.c
+++ b/arch/s390/pci/pci.c
@@ -906,8 +906,6 @@ int zpci_deconfigure_device(struct zpci_dev *zdev)
*/
void zpci_device_reserved(struct zpci_dev *zdev)
{
- if (zdev->has_hp_slot)
- zpci_exit_slot(zdev);
/*
* Remove device from zpci_list as it is going away. This also
* makes sure we ignore subsequent zPCI events for this device.
@@ -925,6 +923,9 @@ void zpci_release_device(struct kref *kref)
struct zpci_dev *zdev = container_of(kref, struct zpci_dev, kref);
int ret;
+ if (zdev->has_hp_slot)
+ zpci_exit_slot(zdev);
+
if (zdev->zbus->bus)
zpci_bus_remove_device(zdev, false);