* [PATCH] nvme-pci: handle the missed doorbell write due to passthrough req
@ 2026-11-17 13:07 Hou Tao
2026-11-20 17:28 ` Christoph Hellwig
2026-11-20 19:54 ` Keith Busch
0 siblings, 2 replies; 3+ messages in thread
From: Hou Tao @ 2026-11-17 13:07 UTC (permalink / raw)
To: linux-nvme
Cc: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg,
Kanchan Joshi, houtao1, xierenfeng
From: Hou Tao <houtao1@huawei.com>
Commit 1cc4cdae2a3b ("nvme-pci: fix missed admin queue sq doorbell
write") lets blk-mq invoke ->commit_rqs when nvme_queue_rq returns
failure or there are still pending requests in the dispatch list.
However, it doesn't handle the case when only passthrough reqs are
queued after the req initiated from nvme_init_ctrl_finish().
nvme_queue_rq() will return BLK_STS_OK for these passthrough reqs due to
REQ_FAILFAST_DRIVER flag, and the controller reset will fail.
Fix it by invoking nvme_commit_rqs when nvme_queue_rq() returns
BLK_STS_OK and bd->last is true.
Fixes: 1cc4cdae2a3b ("nvme-pci: fix missed admin queue sq doorbell write")
Reported-by: Xie Renfeng <xierenfeng@huawei.com>
Signed-off-by: Hou Tao <houtao1@huawei.com>
---
drivers/nvme/host/pci.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 18b3f1b8541c..c7f6f7989168 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -1676,8 +1676,12 @@ static blk_status_t nvme_queue_rq(struct blk_mq_hw_ctx *hctx,
if (unlikely(!test_bit(NVMEQ_ENABLED, &nvmeq->flags)))
return BLK_STS_IOERR;
- if (unlikely(!nvme_check_ready(&dev->ctrl, req, true)))
- return nvme_fail_nonready_command(&dev->ctrl, req);
+ if (unlikely(!nvme_check_ready(&dev->ctrl, req, true))) {
+ ret = nvme_fail_nonready_command(&dev->ctrl, req);
+ if (ret == BLK_STS_OK && bd->last)
+ nvme_commit_rqs(hctx);
+ return ret;
+ }
ret = nvme_prep_rq(req);
if (unlikely(ret))
--
2.29.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] nvme-pci: handle the missed doorbell write due to passthrough req
2026-11-17 13:07 [PATCH] nvme-pci: handle the missed doorbell write due to passthrough req Hou Tao
@ 2026-11-20 17:28 ` Christoph Hellwig
2026-11-20 19:54 ` Keith Busch
1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2026-11-20 17:28 UTC (permalink / raw)
To: Hou Tao
Cc: linux-nvme, Keith Busch, Jens Axboe, Christoph Hellwig,
Sagi Grimberg, Kanchan Joshi, houtao1, xierenfeng
Looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] nvme-pci: handle the missed doorbell write due to passthrough req
2026-11-17 13:07 [PATCH] nvme-pci: handle the missed doorbell write due to passthrough req Hou Tao
2026-11-20 17:28 ` Christoph Hellwig
@ 2026-11-20 19:54 ` Keith Busch
1 sibling, 0 replies; 3+ messages in thread
From: Keith Busch @ 2026-11-20 19:54 UTC (permalink / raw)
To: linux-nvme, Hou Tao
Cc: Jens Axboe, Christoph Hellwig, Sagi Grimberg, Kanchan Joshi,
houtao1, xierenfeng
On Tue, 17 Nov 2026 21:07:43 +0800, Hou Tao wrote:
> Commit 1cc4cdae2a3b ("nvme-pci: fix missed admin queue sq doorbell
> write") lets blk-mq invoke ->commit_rqs when nvme_queue_rq returns
> failure or there are still pending requests in the dispatch list.
> However, it doesn't handle the case when only passthrough reqs are
> queued after the req initiated from nvme_init_ctrl_finish().
> nvme_queue_rq() will return BLK_STS_OK for these passthrough reqs due to
> REQ_FAILFAST_DRIVER flag, and the controller reset will fail.
>
> [...]
Thanks, applied to nvme-7.4.
[1/1] nvme-pci: handle the missed doorbell write due to passthrough req
commit: 4af3ea9d8049d883a912a5fab5eeb483982ad9a9
--
Keith Busch <kbusch@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-20 19:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-17 13:07 [PATCH] nvme-pci: handle the missed doorbell write due to passthrough req Hou Tao
2026-11-20 17:28 ` Christoph Hellwig
2026-11-20 19:54 ` Keith Busch
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox