Re: [PATCH] PCI: rzg3s-host: Treat link-down as -ENODEV instead of error
From: Claudiu Beznea
Date: Wed Apr 01 2026 - 11:51:30 EST
Hi, John,
On 4/1/26 17:33, John Madieu wrote:
rzg3s_pcie_host_init() failing to establish a PCIe link does not
necessarily indicate a hardware or driver error; it may simply mean no
card is inserted. Demote the message from dev_err_probe() to dev_info()
and return -ENODEV so the driver defers gracefully rather than printing
a spurious error.
Signed-off-by: John Madieu <john.madieu.xa@xxxxxxxxxxxxxx>
---
drivers/pci/controller/pcie-rzg3s-host.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/controller/pcie-rzg3s-host.c b/drivers/pci/controller/pcie-rzg3s-host.c
index bfc210e696ed..03be10aa5b54 100644
--- a/drivers/pci/controller/pcie-rzg3s-host.c
+++ b/drivers/pci/controller/pcie-rzg3s-host.c
@@ -1653,9 +1653,10 @@ rzg3s_pcie_host_setup(struct rzg3s_pcie_host *host,
if (ret)
return dev_err_probe(dev, ret, "Failed to init IRQ domain\n");
- ret = rzg3s_pcie_host_init(host);
- if (ret) {
- dev_err_probe(dev, ret, "Failed to initialize the HW!\n");
+ /* Failure to get a link might just be that no cards are inserted */
+ if (rzg3s_pcie_host_init(host)) {
However rzg3s_pcie_host_init() can return other error codes not related to a link being down. In that case the error will be masked.
If this link down message is necessary then maybe move it in rzg3s_pcie_host_init() itself or move the link up specific code outside of rzg3s_pcie_host_init().
Thank you,
Claudiu
+ dev_info(dev, "PCIe link down!\n");
+ ret = -ENODEV;
goto teardown_irqdomain;
}