summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Butler <wab@google.com>2024-01-10 18:28:55 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-11-01 01:58:25 +0100
commite2c03a2c838e13c8d7342b455f53bb432b4d4c8c (patch)
tree9e12f6ed73f4e21300c5c4545bb0391f6eeadb20
parented67a5b99e4dbf6d10cd7d823753e72dcce29938 (diff)
downloadlinux-e2c03a2c838e13c8d7342b455f53bb432b4d4c8c.tar.gz
linux-e2c03a2c838e13c8d7342b455f53bb432b4d4c8c.tar.bz2
linux-e2c03a2c838e13c8d7342b455f53bb432b4d4c8c.zip
nvme-pci: set doorbell config before unquiescing
[ Upstream commit 06c59d427017fcde3107c236177fcc74c9db7909 ] During resets, if queues are unquiesced first, then the host can submit IOs to the controller using shadow doorbell logic but the controller won't be aware. This can lead to necessary MMIO doorbells from being not issued, causing requests to be delayed and timed-out. Signed-off-by: William Butler <wab@google.com> Signed-off-by: Keith Busch <kbusch@kernel.org> Stable-dep-of: 26bc0a81f64c ("nvme-pci: fix race condition between reset and nvme_dev_disable()") Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/nvme/host/pci.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 32b5cc76a022..61c9b175e035 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -2757,10 +2757,10 @@ static void nvme_reset_work(struct work_struct *work)
* controller around but remove all namespaces.
*/
if (dev->online_queues > 1) {
+ nvme_dbbuf_set(dev);
nvme_unquiesce_io_queues(&dev->ctrl);
nvme_wait_freeze(&dev->ctrl);
nvme_pci_update_nr_queues(dev);
- nvme_dbbuf_set(dev);
nvme_unfreeze(&dev->ctrl);
} else {
dev_warn(dev->ctrl.device, "IO queues lost\n");