linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Sagi Grimberg <sagi@grimberg.me>
Cc: Keith Busch <kbusch@kernel.org>,
	James Smart <james.smart@broadcom.com>,
	linux-nvme@lists.infradead.org
Subject: [PATCH 3/3] nvme: allocate the keep alive request using BLK_MQ_REQ_NOWAIT
Date: Wed,  3 Mar 2021 13:53:04 +0100	[thread overview]
Message-ID: <20210303125304.1200789-4-hch@lst.de> (raw)
In-Reply-To: <20210303125304.1200789-1-hch@lst.de>

To avoid an error recovery deadlock where the keep alive work is waiting
for a request and thus can't be flushed to make progress for tearing down
the controller.  Also print the error code returned from
blk_mq_alloc_request to help debugging any future issues in this code.

Based on an earlier patch from Hannes Reinecke <hare@suse.de>.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/nvme/host/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index bdeb3feae61899..8a4a9fe96cdf83 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1241,10 +1241,10 @@ static void nvme_keep_alive_work(struct work_struct *work)
 	}
 
 	rq = nvme_alloc_request(ctrl->admin_q, &ctrl->ka_cmd,
-				BLK_MQ_REQ_RESERVED);
+				BLK_MQ_REQ_RESERVED | BLK_MQ_REQ_NOWAIT);
 	if (IS_ERR(rq)) {
 		/* allocation failure, reset the controller */
-		dev_err(ctrl->device, "keep-alive failed\n");
+		dev_err(ctrl->device, "keep-alive failed: %ld\n", PTR_ERR(rq));
 		nvme_reset_ctrl(ctrl);
 		return;
 	}
-- 
2.29.2


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  parent reply	other threads:[~2021-03-03 15:02 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-03 12:53 reserved tag allocation fixups Christoph Hellwig
2021-03-03 12:53 ` [PATCH 1/3] nvme-fabrics: only reserve a single tag Christoph Hellwig
2021-03-03 21:03   ` Daniel Wagner
2021-03-03 21:26   ` Chaitanya Kulkarni
2021-03-04  7:02   ` Hannes Reinecke
2021-03-05 20:51   ` Sagi Grimberg
2021-03-06  7:09     ` Christoph Hellwig
2021-03-15 17:12       ` Sagi Grimberg
2021-03-03 12:53 ` [PATCH 2/3] nvme: merge nvme_keep_alive into nvme_keep_alive_work Christoph Hellwig
2021-03-03 21:01   ` Daniel Wagner
2021-03-03 21:24   ` Chaitanya Kulkarni
2021-03-03 21:53   ` Chaitanya Kulkarni
2021-03-04  7:02   ` Hannes Reinecke
2021-03-15 17:13   ` Sagi Grimberg
2021-03-03 12:53 ` Christoph Hellwig [this message]
2021-03-03 21:00   ` [PATCH 3/3] nvme: allocate the keep alive request using BLK_MQ_REQ_NOWAIT Daniel Wagner
2021-03-03 21:22   ` Chaitanya Kulkarni
2021-03-04  7:03   ` Hannes Reinecke
2021-03-15 17:13   ` Sagi Grimberg

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=20210303125304.1200789-4-hch@lst.de \
    --to=hch@lst.de \
    --cc=james.smart@broadcom.com \
    --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;
as well as URLs for NNTP newsgroup(s).