summaryrefslogtreecommitdiffstats
path: root/drivers/nvme/host/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/nvme/host/pci.c')
-rw-r--r--drivers/nvme/host/pci.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 0cee23651aa7..9b2deba0bc91 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -272,7 +272,7 @@ static void nvme_queue_scan(struct nvme_dev *dev)
* Do not queue new scan work when a controller is reset during
* removal.
*/
- if (dev->ctrl.state != NVME_CTRL_DELETING)
+ if (dev->ctrl.state == NVME_CTRL_LIVE)
queue_work(nvme_workq, &dev->scan_work);
}
@@ -1659,7 +1659,6 @@ static int nvme_dev_add(struct nvme_dev *dev)
nvme_free_queues(dev, dev->online_queues);
}
- nvme_queue_scan(dev);
return 0;
}
@@ -1893,6 +1892,9 @@ static void nvme_reset_work(struct work_struct *work)
dev_warn(dev->ctrl.device, "failed to mark controller live\n");
goto out;
}
+
+ if (dev->online_queues > 1)
+ nvme_queue_scan(dev);
return;
out:
OpenPOWER on IntegriCloud