All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Avoid reset work on watchdog timer function during error recovery
@ 2016-04-06 20:30 Guilherme G. Piccoli
  2016-04-06 20:50 ` Keith Busch
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Guilherme G. Piccoli @ 2016-04-06 20:30 UTC (permalink / raw)


This patch adds a check on nvme_watchdog_timer() function to avoid the
call to reset_work() when an error recovery process is ongoing on
controller. The check is made by looking at pci_channel_offline()
result.

If we don't check for this on nvme_watchdog_timer(), error recovery
mechanism can't recover well, because reset_work() won't be able to
do its job (since we're in the middle of an error) and so the
controller is removed from the system before error recovery mechanism
can perform slot reset (which would allow the adapter to recover).

Signed-off-by: Guilherme G. Piccoli <gpiccoli at linux.vnet.ibm.com>
---
 drivers/nvme/host/pci.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 24ccda3..3cc146d 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -1357,10 +1357,12 @@ static void nvme_watchdog_timer(unsigned long data)
 
 	/*
 	 * Skip controllers currently under reset.
+	 * Also, skip controllers going through PCI error recovery.
 	 */
 	if (!work_pending(&dev->reset_work) && !work_busy(&dev->reset_work) &&
 	    ((csts & NVME_CSTS_CFS) ||
-	     (dev->subsystem && (csts & NVME_CSTS_NSSRO)))) {
+	    (dev->subsystem && (csts & NVME_CSTS_NSSRO))) &&
+	    !pci_channel_offline(to_pci_dev(dev->dev))) {
 		if (queue_work(nvme_workq, &dev->reset_work)) {
 			dev_warn(dev->dev,
 				"Failed status: 0x%x, reset controller.\n",
-- 
2.1.0

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

end of thread, other threads:[~2016-04-12 23:33 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-06 20:30 [PATCH] Avoid reset work on watchdog timer function during error recovery Guilherme G. Piccoli
2016-04-06 20:50 ` Keith Busch
2016-04-07  8:05 ` Johannes Thumshirn
2016-04-07 13:11 ` Christoph Hellwig
2016-04-07 13:17   ` Guilherme G. Piccoli
2016-04-07 13:18   ` Sagi Grimberg
2016-04-07 13:26     ` Christoph Hellwig
2016-04-07 14:24   ` Keith Busch
2016-04-07 15:42     ` Guilherme G. Piccoli
2016-04-07 15:46       ` Keith Busch
2016-04-07 16:03         ` Guilherme G. Piccoli
2016-04-12 19:01           ` Christoph Hellwig
2016-04-12 23:33             ` Guilherme G. Piccoli

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.