[PATCH 2/4] nvme-pci: unquiesce admin queue before nvme_init_ctrl_finish()

Hannes Reinecke hare at suse.de
Fri Oct 20 07:25:58 PDT 2023


We should be unquiesce the admin queue after setting the state to
'CONNECTING', but before calling into nvme_init_ctrl_finish().

Signed-off-by: Hannes Reinecke <hare at suse.de>
---
 drivers/nvme/host/pci.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 60a08dfe8d75..5b6dec052dfe 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -2709,7 +2709,6 @@ static void nvme_reset_work(struct work_struct *work)
 	result = nvme_pci_enable(dev);
 	if (result)
 		goto out_unlock;
-	nvme_unquiesce_admin_queue(&dev->ctrl);
 	mutex_unlock(&dev->shutdown_lock);
 
 	/*
@@ -2723,6 +2722,8 @@ static void nvme_reset_work(struct work_struct *work)
 		goto out;
 	}
 
+	nvme_unquiesce_admin_queue(&dev->ctrl);
+
 	result = nvme_init_ctrl_finish(&dev->ctrl, was_suspend);
 	if (result)
 		goto out;
@@ -3019,6 +3020,8 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		goto out_disable;
 	}
 
+	nvme_unquiesce_admin_queue(&dev->ctrl);
+
 	result = nvme_init_ctrl_finish(&dev->ctrl, false);
 	if (result)
 		goto out_disable;
-- 
2.35.3




More information about the Linux-nvme mailing list