From: Keith Busch Date: Mon, 23 Jun 2014 21:24:53 +0000 (-0600) Subject: NVMe: Use pci_stop_and_remove_bus_device_locked() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c81f49758a677e878df4e6a33f29d8ce401bf66d;p=linux-beck.git 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 Signed-off-by: Matthew Wilcox Signed-off-by: Jens Axboe --- diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c index f3103aa91d2e..48a712734b55 100644 --- a/drivers/block/nvme-core.c +++ b/drivers/block/nvme-core.c @@ -2759,7 +2759,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; }