Skip to contentSkip to conversation

NVMe: Use pci_stop_and_remove_bus_device_locked()

PATCH New Keith Busch 1 participant 1 message Jun 23, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 NVMe: Use pci_stop_and_remove_bus_device_locked()

Race conditions are theoretically possible between the NVMe 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 NVMe code use pci_stop_and_remove_bus_device_locked().

Signed-off-by Keith Busch <keith.busch at intel.com>
---
 drivers/block/nvme-core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/nvme-core.c +1 -1
index 522a746..69bad18 100644
@@ -2692,7 +2692,7 @@ static int nvme_remove_dead_ctrl(void *arg)
 	struct pci_dev *pdev = dev->pci_dev;
 
 	if (pci_get_drvdata(pdev))
-		pci_stop_and_remove_bus_device(pdev);
+		pci_stop_and_remove_bus_device_locked(pdev);
 	kref_put(&dev->kref, nvme_free_dev);
 	return 0;
 }
Signature · 1 line
1.7.10.4