[PATCH 1/2] nvme-pci: Print error message on failure in nvme_probe
Gerd Bayer
gbayer at linux.ibm.com
Tue Oct 21 01:13:12 PDT 2025
On Mon, 2025-10-20 at 23:35 +0000, Chaitanya Kulkarni wrote:
> On 10/20/25 08:29, Gerd Bayer wrote:
> > Add a new error message like
> > nvme nvme0: probe failed on 2004:00:00.0 (result: -19)
> > that makes failures to probe visible in the kernel log.
> >
> > Signed-off-by: Gerd Bayer <gbayer at linux.ibm.com>
> > ---
> > drivers/nvme/host/pci.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
> > index
> > c916176bd9f058b49e6e6768675711df52b15765..7544c4bac2c4a230d32cf729a
> > bb9e94bf93a921f 100644
> > --- a/drivers/nvme/host/pci.c
> > +++ b/drivers/nvme/host/pci.c
> > @@ -3519,6 +3519,8 @@ static int nvme_probe(struct pci_dev *pdev,
> > const struct pci_device_id *id)
> > out_dev_unmap:
> > nvme_dev_unmap(dev);
> > out_uninit_ctrl:
> > + dev_err(dev->ctrl.device, "probe failed on %s (result:
> > %d)\n",
> > + dev_name(&pdev->dev), result);
>
> is it really have to be dev_err ? or dev_dbg would work ?
I've almost overlooked this question, since I'm not subscribed to the
list - found it on lore.
dev_dbg is too weak IMHO. I assmume most installations don't log debug-
level and would require a repro with dynamic_debug turned on. My intent
was to highlight the abnormal behavior even in default kernel configs.
I was following the example in mlx5_core that produces error-level
messages when probe fails.
Thanks,
Gerd
>
>
> > nvme_uninit_ctrl(&dev->ctrl);
> > out_put_ctrl:
> > nvme_put_ctrl(&dev->ctrl);
> >
>
> -ck
>
More information about the Linux-nvme
mailing list