All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] NVMe: Skip async events for degraded controllers
@ 2016-04-08 22:09 Keith Busch
  2016-04-08 23:11 ` Christoph Hellwig
  2016-04-10 17:20 ` Sagi Grimberg
  0 siblings, 2 replies; 3+ messages in thread
From: Keith Busch @ 2016-04-08 22:09 UTC (permalink / raw)


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.

 drivers/nvme/host/pci.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 28d434d..1e176c8 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -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));
 
-- 
2.7.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] NVMe: Skip async events for degraded controllers
  2016-04-08 22:09 [PATCH] NVMe: Skip async events for degraded controllers Keith Busch
@ 2016-04-08 23:11 ` Christoph Hellwig
  2016-04-10 17:20 ` Sagi Grimberg
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2016-04-08 23:11 UTC (permalink / raw)


On Fri, Apr 08, 2016@04:09:56PM -0600, Keith Busch wrote:
> 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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] NVMe: Skip async events for degraded controllers
  2016-04-08 22:09 [PATCH] NVMe: Skip async events for degraded controllers Keith Busch
  2016-04-08 23:11 ` Christoph Hellwig
@ 2016-04-10 17:20 ` Sagi Grimberg
  1 sibling, 0 replies; 3+ messages in thread
From: Sagi Grimberg @ 2016-04-10 17:20 UTC (permalink / raw)


Look good,

Reviewed-by: Sagi Grimberg <sagi at grimberg.me>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-10 17:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-08 22:09 [PATCH] NVMe: Skip async events for degraded controllers Keith Busch
2016-04-08 23:11 ` Christoph Hellwig
2016-04-10 17:20 ` Sagi Grimberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.