NVMe: Skip async events for degraded controllers
PATCH 1/1 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.
---
This is to fix communication with a specific controller, but I thought this was generally applicable anyway. If anyone really wants to see async events on degraded controllers, I can provide this as a quirk instead.
drivers/nvme/host/pci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/nvme/host/pci.c +4 -2
@@ -1890,8 +1890,10 @@ 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); +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 ));
Signature · 1 line
2.7.2
PATCH 1/1 NVMe: Skip async events for degraded controllers
Quoted 9 lines · Keith Busch
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 at intel.com>---
This is to fix communication with a specific controller, but I thought this was generally applicable anyway. If anyone really wants to see async events on degraded controllers, I can provide this as a quirk instead.
Hah, I was going to prepare something fairly similar for Fabrics enablement, so I'm fine with it. But a comment on why we're doing this would be really nice. I wonder if we should simply have a wrapper function for the queue_count check that has a descriptive and has the detailed description might be useful.
Sagi Grimberg
maintainerPATCH 1/1 NVMe: Skip async events for degraded controllers
In reply to Keith BuschLook good,