public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagi@grimberg.me>, Keith Busch <kbusch@kernel.org>,
	linux-nvme@lists.infradead.org, Hannes Reinecke <hare@suse.de>
Subject: [PATCH 2/3] nvme-loop: always quiesce and cancel commands before destroying admin q
Date: Tue, 24 Oct 2023 08:13:36 +0200	[thread overview]
Message-ID: <20231024061337.35621-3-hare@suse.de> (raw)
In-Reply-To: <20231024061337.35621-1-hare@suse.de>

Once ->init_ctrl_finish() is called there may be commands outstanding,
so we should quiesce the admin queue and cancel all commands prior
to call nvme_loop_destroy_admin_queue().

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 drivers/nvme/target/loop.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c
index 48d5df054cd0..9cb434c58075 100644
--- a/drivers/nvme/target/loop.c
+++ b/drivers/nvme/target/loop.c
@@ -466,6 +466,8 @@ static void nvme_loop_reset_ctrl_work(struct work_struct *work)
 out_destroy_io:
 	nvme_loop_destroy_io_queues(ctrl);
 out_destroy_admin:
+	nvme_quiesce_admin_queue(&ctrl->ctrl);
+	nvme_cancel_admin_tagset(&ctrl->ctrl);
 	nvme_loop_destroy_admin_queue(ctrl);
 out_disable:
 	dev_warn(ctrl->ctrl.device, "Removing after reset failure\n");
@@ -600,6 +602,8 @@ static struct nvme_ctrl *nvme_loop_create_ctrl(struct device *dev,
 	return &ctrl->ctrl;
 
 out_remove_admin_queue:
+	nvme_quiesce_admin_queue(&ctrl->ctrl);
+	nvme_cancel_admin_tagset(&ctrl->ctrl);
 	nvme_loop_destroy_admin_queue(ctrl);
 out_free_queues:
 	kfree(ctrl->queues);
-- 
2.35.3



  parent reply	other threads:[~2023-10-24  6:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-24  6:13 [PATCHv2 0/3] nvme: start keep-alive after admin queue setup Hannes Reinecke
2023-10-24  6:13 ` [PATCH 1/3] nvme-tcp: avoid open-coding nvme_tcp_teardown_admin_queue() Hannes Reinecke
2023-10-24  6:13 ` Hannes Reinecke [this message]
2023-10-24  6:13 ` [PATCH 3/3] nvme: start keep-alive after admin queue setup Hannes Reinecke
2023-11-06 17:17   ` Keith Busch
2023-11-20 13:39   ` Sagi Grimberg
2023-11-20 14:19     ` Hannes Reinecke
2023-11-20 14:25       ` Sagi Grimberg
2023-11-20 15:05         ` Hannes Reinecke
2023-11-20 19:03           ` Sagi Grimberg
2023-11-20 16:01     ` Hannes Reinecke
2023-11-20 19:05       ` Sagi Grimberg
2023-11-21  7:29         ` Hannes Reinecke
2023-11-21  9:16           ` Sagi Grimberg
2023-10-26 16:00 ` [PATCHv2 0/3] " Mark O'Donovan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231024061337.35621-3-hare@suse.de \
    --to=hare@suse.de \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox