[PATCH 2/9] nvme: use nvme_wait_ready in nvme_shutdown_ctrl

Keith Busch kbusch at kernel.org
Wed Nov 30 08:15:18 PST 2022


On Wed, Nov 30, 2022 at 03:27:29PM +0100, Pankaj Raghav wrote:
> On 2022-11-30 14:57, Christoph Hellwig wrote:
> > From 2f862232c4428d57dcfdc3b332866a9b2743711d Mon Sep 17 00:00:00 2001
> > From: Christoph Hellwig <hch at lst.de>
> > Date: Wed, 16 Nov 2022 08:54:26 +0100
> > Subject: nvme: use nvme_wait_ready in nvme_shutdown_ctrl
> > 
> > Refactor the code to wait for CSTS state changes so that it can be reused
> > by nvme_shutdown_ctrl.
> > 
> > Signed-off-by: Christoph Hellwig <hch at lst.de>
> 
> One minor nit: I also notice that nvme_wait_ready busy loop sleeps for
> 1~2ms, while the existing shutdown code busy loop sleeps for 100ms. Though,
> I don't think it is an issue.
> 
> Apart from that, the new version looks good to me. Feel free to add to it:

That is indeed a difference, but it's probably a good one. It should
tighten up the time to shutdown more closely to the hardware's
completion, and there's probably some environment where the 10's of
millisecs saved might be meaningful.



More information about the Linux-nvme mailing list