aboutsummaryrefslogtreecommitdiffstats
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.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index d7c33f9361aa..8dcf5a960951 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -1543,15 +1543,10 @@ static void nvme_disable_io_queues(struct nvme_dev *dev)
1543 reinit_completion(&dev->ioq_wait); 1543 reinit_completion(&dev->ioq_wait);
1544 retry: 1544 retry:
1545 timeout = ADMIN_TIMEOUT; 1545 timeout = ADMIN_TIMEOUT;
1546 for (; i > 0; i--) { 1546 for (; i > 0; i--, sent++)
1547 struct nvme_queue *nvmeq = dev->queues[i]; 1547 if (nvme_delete_queue(dev->queues[i], opcode))
1548
1549 if (!pass)
1550 nvme_suspend_queue(nvmeq);
1551 if (nvme_delete_queue(nvmeq, opcode))
1552 break; 1548 break;
1553 ++sent; 1549
1554 }
1555 while (sent--) { 1550 while (sent--) {
1556 timeout = wait_for_completion_io_timeout(&dev->ioq_wait, timeout); 1551 timeout = wait_for_completion_io_timeout(&dev->ioq_wait, timeout);
1557 if (timeout == 0) 1552 if (timeout == 0)
@@ -1693,11 +1688,12 @@ static void nvme_dev_disable(struct nvme_dev *dev, bool shutdown)
1693 nvme_stop_queues(&dev->ctrl); 1688 nvme_stop_queues(&dev->ctrl);
1694 csts = readl(dev->bar + NVME_REG_CSTS); 1689 csts = readl(dev->bar + NVME_REG_CSTS);
1695 } 1690 }
1691
1692 for (i = dev->queue_count - 1; i > 0; i--)
1693 nvme_suspend_queue(dev->queues[i]);
1694
1696 if (csts & NVME_CSTS_CFS || !(csts & NVME_CSTS_RDY)) { 1695 if (csts & NVME_CSTS_CFS || !(csts & NVME_CSTS_RDY)) {
1697 for (i = dev->queue_count - 1; i >= 0; i--) { 1696 nvme_suspend_queue(dev->queues[0]);
1698 struct nvme_queue *nvmeq = dev->queues[i];
1699 nvme_suspend_queue(nvmeq);
1700 }
1701 } else { 1697 } else {
1702 nvme_disable_io_queues(dev); 1698 nvme_disable_io_queues(dev);
1703 nvme_disable_admin_queue(dev, shutdown); 1699 nvme_disable_admin_queue(dev, shutdown);