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

John Madieu posted 1 patch 4 hours ago
drivers/pci/controller/pcie-rzg3s-host.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
[PATCH] PCI: rzg3s-host: Treat link-down as -ENODEV instead of error
Posted by John Madieu 4 hours ago
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@bp.renesas.com>
---
 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;
 	}
 
-- 
2.25.1
Re: [PATCH] PCI: rzg3s-host: Treat link-down as -ENODEV instead of error
Posted by Claudiu Beznea 3 hours ago
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@bp.renesas.com>
> ---
>   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;
>   	}
>
Re: [PATCH] PCI: rzg3s-host: Treat link-down as -ENODEV instead of error
Posted by Geert Uytterhoeven 4 hours ago
On Wed, 1 Apr 2026 at 16:44, John Madieu <john.madieu.xa@bp.renesas.com> 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@bp.renesas.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds