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 767ff4d..570b18a 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 3901edc..bde63f7 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 fa78506..0cf4f70 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;
 }