All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] NVMe: Add more informative error messages
@ 2014-04-11 14:56 Matthew Wilcox
  2014-04-11 15:43 ` Keith Busch
  0 siblings, 1 reply; 2+ messages in thread
From: Matthew Wilcox @ 2014-04-11 14:56 UTC (permalink / raw)



Help people diagnose what is going wrong at initialisation time by
printing out which command has gone wrong and what the device returned.

Signed-off-by: Matthew Wilcox <matthew.r.wilcox at intel.com>

diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c
index 313c0f0..f47fe7c 100644
--- a/drivers/block/nvme-core.c
+++ b/drivers/block/nvme-core.c
@@ -2059,8 +2059,13 @@ static int set_queue_count(struct nvme_dev *dev, int count)
 
 	status = nvme_set_features(dev, NVME_FEAT_NUM_QUEUES, q_count, 0,
 								&result);
-	if (status)
-		return status < 0 ? -EIO : -EBUSY;
+	if (status < 0)
+		return status;
+	if (status > 0) {
+		dev_err(&dev->pci_dev->dev, "Could not set queue count (%d)\n",
+									status);
+		return -EBUSY;
+	}
 	return min(result & 0xffff, result >> 16) + 1;
 }
 
@@ -2196,6 +2201,7 @@ static int nvme_dev_add(struct nvme_dev *dev)
 
 	res = nvme_identify(dev, 0, 1, dma_addr);
 	if (res) {
+		dev_err(&pdev->dev, "Identify Controller failed (%d)\n", res);
 		res = -EIO;
 		goto out;
 	}

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

end of thread, other threads:[~2014-04-11 15:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-11 14:56 [PATCH] NVMe: Add more informative error messages Matthew Wilcox
2014-04-11 15:43 ` Keith Busch

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.