RE: [PATCH] PCI: rzg3s-host: Treat link-down as -ENODEV instead of error

From: Biju Das

Date: Wed Apr 01 2026 - 14:36:14 EST


Hi John,

> -----Original Message-----
> From: John Madieu <john.madieu.xa@xxxxxxxxxxxxxx>
> Sent: 01 April 2026 15:34
> Subject: [PATCH] PCI: rzg3s-host: Treat link-down as -ENODEV instead of error
>
> 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.

Good catch. I am seeing the below error when the Pcie cards not inserted.

2.424257] rzg3s-pcie-host 13400000.pcie: error -ETIMEDOUT: Failed to initialize the HW!
[ 2.432695] rzg3s-pcie-host 13400000.pcie: probe with driver rzg3s-pcie-host failed with error -110

>
> 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)) {
> + dev_info(dev, "PCIe link down!\n");
> + ret = -ENODEV;
> goto teardown_irqdomain;
> }

Based on the error,

2.424257] rzg3s-pcie-host 13400000.pcie: error -ETIMEDOUT: Failed to initialize the HW!

/* Wait for link up */
ret = readl_poll_timeout(host->axi + RZG3S_PCI_PCSTAT1, val,
!(val & RZG3S_PCI_PCSTAT1_DL_DOWN_STS),
PCIE_LINK_WAIT_SLEEP_MS * MILLI,
PCIE_LINK_WAIT_SLEEP_MS * MILLI *
PCIE_LINK_WAIT_MAX_RETRIES);
if (ret)
goto cfg_resets_deassert;

We need to capture this error for link up/down.

Cheers,
Biju

>
> --
> 2.25.1
>