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@wdc.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Gerd Bayer <gbayer@linux.ibm.com>
---
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..ce563e93d29443a25e9236d0b6d8152ee85796d7 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");
result = -ENODEV;
goto disable;
}
--
2.48.1
On 22/10/2025 11:33, Gerd Bayer wrote:
> 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@wdc.com>
> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
> Signed-off-by: Gerd Bayer <gbayer@linux.ibm.com>
> ---
> 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..ce563e93d29443a25e9236d0b6d8152ee85796d7 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");
we should add "\n" as a good practice, no?
> result = -ENODEV;
> goto disable;
> }
>
On Thu, 2025-10-23 at 11:55 +0100, John Garry wrote:
> On 22/10/2025 11:33, Gerd Bayer wrote:
> > 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@wdc.com>
> > Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
> > Signed-off-by: Gerd Bayer <gbayer@linux.ibm.com>
> > ---
> > 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..ce563e93d29443a25e9236d0b6d8152ee85796d7 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");
>
> we should add "\n" as a good practice, no?
that's a very valid point. Sheesh - how much can go wrong...
Thanks,
Gerd
>
> > result = -ENODEV;
> > goto disable;
> > }
> >
On Wed, Oct 22, 2025 at 12:33:17PM +0200, Gerd Bayer wrote: > Add a debug log spelling out that reading the CSTS register failed - to > distinguish this from other reasons for ENODEV. Looks good: Reviewed-by: Christoph Hellwig <hch@lst.de>
© 2016 - 2026 Red Hat, Inc.