MPT / PCI: Use pci_stop_and_remove_bus_device_locked()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 10 Jan 2014 14:27:56 +0000 (15:27 +0100)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 14 Jan 2014 19:14:25 +0000 (12:14 -0700)
Race conditions are theoretically possible between the MPT PCI device
removal and the generic PCI bus rescan and device removal that can be
triggered via sysfs.

To avoid those race conditions make the MPT PCI code use
pci_stop_and_remove_bus_device_locked().

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/message/fusion/mptbase.c
drivers/scsi/mpt2sas/mpt2sas_base.c
drivers/scsi/mpt3sas/mpt3sas_base.c

index 767ff4d839f448168e475ba3e506350977490ac6..570b18a113ffca813d2588dfc02c879e626fae9e 100644 (file)
@@ -346,7 +346,7 @@ static int mpt_remove_dead_ioc_func(void *arg)
        if ((pdev == NULL))
                return -1;
 
-       pci_stop_and_remove_bus_device(pdev);
+       pci_stop_and_remove_bus_device_locked(pdev);
        return 0;
 }
 
index 3901edc35812938b2ef9d8f9a796d17811b42c59..bde63f7452bdd368a2fc06db8c83f72a7a049cbe 100644 (file)
@@ -128,7 +128,7 @@ static int mpt2sas_remove_dead_ioc_func(void *arg)
                pdev = ioc->pdev;
                if ((pdev == NULL))
                        return -1;
-               pci_stop_and_remove_bus_device(pdev);
+               pci_stop_and_remove_bus_device_locked(pdev);
                return 0;
 }
 
index fa785062e97b6779da8b538343b95d828ea00182..0cf4f7000f94db8439fb99490ddeaa26f86d0fdd 100644 (file)
@@ -131,7 +131,7 @@ static int mpt3sas_remove_dead_ioc_func(void *arg)
        pdev = ioc->pdev;
        if ((pdev == NULL))
                return -1;
-       pci_stop_and_remove_bus_device(pdev);
+       pci_stop_and_remove_bus_device_locked(pdev);
        return 0;
 }