]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
s390/pci: remove hotplug slot when releasing the device
authorGerd Bayer <gbayer@linux.ibm.com>
Fri, 10 Nov 2023 11:06:42 +0000 (12:06 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Tue, 20 Feb 2024 13:37:32 +0000 (14:37 +0100)
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>
arch/s390/pci/pci.c

index 17267f659d223a136fc8f573683de61cb1d63e42..c87b8aff5285bd0838ec9ae293e8c587372982f4 100644 (file)
@@ -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);