diff options
author | Keith Busch <keith.busch@intel.com> | 2017-06-28 01:44:05 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2017-06-28 01:44:05 +0200 |
commit | ebef7368571d88f0f80b817e6898075c62265b4e (patch) | |
tree | d38abb27b86a8f58077047372cf531bdfd7ddb2b /drivers/nvme/host/pci.c | |
parent | Merge branch 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm (diff) | |
download | linux-ebef7368571d88f0f80b817e6898075c62265b4e.tar.xz linux-ebef7368571d88f0f80b817e6898075c62265b4e.zip |
nvme/pci: Fix stuck nvme reset
The controller state is set to resetting prior to disabling the
controller, so this patch accounts for that state when deciding if it
needs to freeze the queues. Without this, an 'nvme reset /dev/nvme0'
blocks forever because the queues were never frozen.
Fixes: 82b057caefaf ("nvme-pci: fix multiple ctrl removal scheduling")
Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to '')
-rw-r--r-- | drivers/nvme/host/pci.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 951042a375d6..40c7581caeb0 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -1805,7 +1805,8 @@ static void nvme_dev_disable(struct nvme_dev *dev, bool shutdown) if (pci_is_enabled(pdev)) { u32 csts = readl(dev->bar + NVME_REG_CSTS); - if (dev->ctrl.state == NVME_CTRL_LIVE) + if (dev->ctrl.state == NVME_CTRL_LIVE || + dev->ctrl.state == NVME_CTRL_RESETTING) nvme_start_freeze(&dev->ctrl); dead = !!((csts & NVME_CSTS_CFS) || !(csts & NVME_CSTS_RDY) || pdev->error_state != pci_channel_io_normal); |