[PATCH v3 2/2] nvme-pci: Add debug message on fail to read CSTS

From: Gerd Bayer
Date: Fri Oct 24 2025 - 07:38:34 EST


Add a debug log spelling out that reading the CSTS register failed - to
distinguish this from other reasons for ENODEV.

Reviewed-by: Wilfred Mallawa <wilfred.mallawa@xxxxxxx>
Reviewed-by: Chaitanya Kulkarni <kch@xxxxxxxxxx>
Reviewed-by: Christoph Hellwig <hch@xxxxxx>
Signed-off-by: Gerd Bayer <gbayer@xxxxxxxxxxxxx>
---
drivers/nvme/host/pci.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 8c624960c9f67e0cc8409023de5e532d6ed9b3ac..15c12e6cba884a9bb5248f70d75490254014b9f9 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -2906,6 +2906,7 @@ static int nvme_pci_enable(struct nvme_dev *dev)
pci_set_master(pdev);

if (readl(dev->bar + NVME_REG_CSTS) == -1) {
+ dev_dbg(dev->ctrl.device, "reading CSTS register failed\n");
result = -ENODEV;
goto disable;
}

--
2.48.1