nvme-pci: fix freeze accounting for error handling
authorKeith Busch <kbusch@kernel.org>
Tue, 12 Jul 2022 15:16:32 +0000 (08:16 -0700)
committerChristoph Hellwig <hch@lst.de>
Thu, 14 Jul 2022 14:35:25 +0000 (16:35 +0200)
commit081f5e753c9c4cd1dd86000bcc7f5fe14cbdcab0
tree9989e9c3b934f0737e3c87d3496687747c7140d5
parent6b0de7d0f3285df849be2b3cc94fc3a0a31987bf
nvme-pci: fix freeze accounting for error handling

A reset on a live device experiencing a link error still needs to have
the queue freeze state started for the subsequent reinitialization. Skip
only the register read if the device is not present instead of bypassing
the freeze checks.

Fixes: b98235d3a471e ("nvme-pci: harden drive presence detect in nvme_dev_disable()")
Reported-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/pci.c