]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
NVMe: Skip async events for degraded controllers
authorKeith Busch <keith.busch@intel.com>
Tue, 12 Apr 2016 17:13:11 +0000 (11:13 -0600)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 1 Jun 2017 20:41:14 +0000 (13:41 -0700)
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>
(cherry picked from commit 21f033f7c72e9505c46c6555b019b907dc39dfcd)

Orabug: 25130845

Signed-off-by: Ashok Vairavan <ashok.vairavan@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/nvme/host/pci.c

index b20059e9a7e2a87e82c896a0289836c308325260..7cdedeb479ad83e9623d81882cdb97f97de007d2 100644 (file)
@@ -1903,8 +1903,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));
        /*