nvme: use nvme_wait_ready in nvme_shutdown_ctrl
authorChristoph Hellwig <hch@lst.de>
Wed, 16 Nov 2022 07:54:26 +0000 (08:54 +0100)
committerChristoph Hellwig <hch@lst.de>
Tue, 6 Dec 2022 13:36:53 +0000 (14:36 +0100)
commite6d275de2e4aaebdc97aa022c031a0dcc475efa4
treeb19b4415f222759ee420f562821eb33ab3e7e034
parentc76b8308e4c9148e44e0c7e086ab6d8b4bb10162
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.  This reduces the delay between each iteration
that checks CSTS from 100ms in the shutdown code to the 1 to 2ms range
done during enable, matching the changes from commit 3e98c2443f5c that
were only applied to the enable/disable path.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Pankaj Raghav <p.raghav@samsung.com>
drivers/nvme/host/core.c