linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nvme/pci: Log PCI_STATUS when the controller dies
@ 2016-11-30  1:18 Andy Lutomirski
  2016-11-30 15:25 ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Lutomirski @ 2016-11-30  1:18 UTC (permalink / raw)


Signed-off-by: Andy Lutomirski <luto at kernel.org>
---
 drivers/nvme/host/pci.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 0248d0e21fee..b4527e5b1364 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -1292,10 +1292,16 @@ static void nvme_watchdog_timer(unsigned long data)
 
 	/* Skip controllers under certain specific conditions. */
 	if (nvme_should_reset(dev, csts)) {
-		if (!nvme_reset(dev))
+		if (!nvme_reset(dev)) {
+			/* Read a config register to help see what died. */
+			u16 pci_status = 0xffff;
+
+			pci_read_config_word(to_pci_dev(dev->dev),
+					     PCI_STATUS, &pci_status);
 			dev_warn(dev->dev,
-				"Failed status: 0x%x, reset controller.\n",
-				csts);
+				"controller is down; will reset: CSTS=0x%x, PCI_STATUS=0x%hx\n",
+				 csts, pci_status);
+		}
 		return;
 	}
 
-- 
2.9.3

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

end of thread, other threads:[~2016-12-01 18:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-30  1:18 [PATCH] nvme/pci: Log PCI_STATUS when the controller dies Andy Lutomirski
2016-11-30 15:25 ` Jens Axboe
2016-11-30 18:28   ` Andy Lutomirski
2016-12-01 18:09     ` Keith Busch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).