From: Linjun Bao <meljbao@gmail.com>
To: Keith Busch <kbusch@kernel.org>
Cc: Jens Axboe <axboe@fb.com>, Christoph Hellwig <hch@lst.de>,
Sagi Grimberg <sagi@grimberg.me>,
linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org
Subject: Re: [PATCH] nvme: avoid missing db ring during reset
Date: Sat, 26 Apr 2025 00:35:24 +0800 [thread overview]
Message-ID: <b6880ffc-4ce5-49cd-b08d-de2c82b21f4f@gmail.com> (raw)
In-Reply-To: <aAuu1RvgwyfXI3AL@kbusch-mbp.dhcp.thefacebook.com>
On 4/25/2025 11:48 PM, Keith Busch wrote:
> On Fri, Apr 25, 2025 at 08:01:45PM +0800, Linjun Bao wrote:
>> During nvme reset, there is a rare case, when user admin cmd such
>> as smart-log and nvme_admin_create_sq from nvme_setup_io_queues
>> happen to in the same blk_mq dispatch list, and the user cmd is
>> the last one. nvme_admin_create_sq is dispatched first in
>> nvme_queue_rq(), nvme_write_sq_db() is called but immediately
>> returns without writing the doorbell because it's not masked
>> "last". The subsequent smart-log ioctl fails fast hitting
>> nvme_fail_nonready_cmd(), skipping both nvme_sq_copy_cmd() and
>> nvme_write_sq_db(), so no doorbell write ever occurs. The
>> nvme_admin_create_sq fails timeout finally.
>
> The block layer is supposed to call the driver's commit_rqs() function
> if anything in the dispatch list wasn't successful, which should notify
> the controller of any pending SQEs. Is that not happening here?
Yes, in this case, the last user admin cmd will fail nvme_host_path_errror
finally, but ret BLK_STS_OK, which will let blk_mq_dispatch_rq_list skips
the commit_rqs, thus missing updating the SQ doorbell.
prev parent reply other threads:[~2025-04-25 16:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-25 12:01 [PATCH] nvme: avoid missing db ring during reset Linjun Bao
2025-04-25 15:48 ` Keith Busch
2025-04-25 16:35 ` Linjun Bao [this message]
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=b6880ffc-4ce5-49cd-b08d-de2c82b21f4f@gmail.com \
--to=meljbao@gmail.com \
--cc=axboe@fb.com \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-kernel@vger.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