nvme-pci: return early on ctrl state mismatch in nvme_reset_work
authorChristoph Hellwig <hch@lst.de>
Tue, 22 Nov 2022 07:48:13 +0000 (08:48 +0100)
committerChristoph Hellwig <hch@lst.de>
Tue, 6 Dec 2022 13:36:54 +0000 (14:36 +0100)
commit8cb9f10b7151e308824cdcf3168010d673e7888c
tree981747922c8ed23f23cfb7ba0c419169b275c1c2
parent7d879c90ae6cf58f4a4caad8562d700b95bc1dbe
nvme-pci: return early on ctrl state mismatch in nvme_reset_work

The only way nvme_reset_work could be called when not in resetting state
is if a reset and remove happen near the same time.  This should not
happen, but if it did we don't want the reset work to disable the
controller because the remove is already doing that.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
drivers/nvme/host/pci.c