summaryrefslogtreecommitdiff
path: root/drivers/nvme/host/pci.c
diff options
context:
space:
mode:
authorKeith Busch <keith.busch@intel.com>2016-04-12 17:13:11 (GMT)
committerJens Axboe <axboe@fb.com>2016-04-12 19:44:00 (GMT)
commit21f033f7c72e9505c46c6555b019b907dc39dfcd (patch)
treee579d6001699450d2cc39f01638429cf51929571 /drivers/nvme/host/pci.c
parent8093f7ca73c1633e458c16a74b51bcc3c94564c4 (diff)
downloadlinux-21f033f7c72e9505c46c6555b019b907dc39dfcd.tar.xz
NVMe: Skip async events for degraded controllers
If the controller is degraded, the driver should stay out of the way so the user can recover the drive. This patch skips driver initiated async event requests when the drive is in this state. Signed-off-by: Keith Busch <keith.busch@intel.com> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/nvme/host/pci.c')
-rw-r--r--drivers/nvme/host/pci.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 008c9ee..7508a0a 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -1855,8 +1855,16 @@ static void nvme_reset_work(struct work_struct *work)
if (result)
goto out;
- dev->ctrl.event_limit = NVME_NR_AEN_COMMANDS;
- queue_work(nvme_workq, &dev->async_work);
+ /*
+ * A controller that can not execute IO typically requires user
+ * intervention to correct. For such degraded controllers, the driver
+ * should not submit commands the user did not request, so skip
+ * registering for asynchronous event notification on this condition.
+ */
+ if (dev->online_queues > 1) {
+ dev->ctrl.event_limit = NVME_NR_AEN_COMMANDS;
+ queue_work(nvme_workq, &dev->async_work);
+ }
mod_timer(&dev->watchdog_timer, round_jiffies(jiffies + HZ));