[PATCH v2 5/5] PCI: dwc: Don't return error when wait for link up

Richard Zhu posted 5 patches 3 months, 3 weeks ago
There is a newer version of this series
[PATCH v2 5/5] PCI: dwc: Don't return error when wait for link up
Posted by Richard Zhu 3 months, 3 weeks ago
When wait for link up, both the link up and link down are normal
results, not mistakes.
Don't return error, since the results had been notified.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
---
 drivers/pci/controller/dwc/pcie-designware-host.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
index 228484e3ea4a..fe6997c9c1d5 100644
--- a/drivers/pci/controller/dwc/pcie-designware-host.c
+++ b/drivers/pci/controller/dwc/pcie-designware-host.c
@@ -1108,9 +1108,7 @@ int dw_pcie_resume_noirq(struct dw_pcie *pci)
 	if (ret)
 		return ret;
 
-	ret = dw_pcie_wait_for_link(pci);
-	if (ret)
-		return ret;
+	dw_pcie_wait_for_link(pci);
 
 	return ret;
 }
-- 
2.37.1
Re: [PATCH v2 5/5] PCI: dwc: Don't return error when wait for link up
Posted by Frank Li 3 months, 3 weeks ago
On Wed, Jun 18, 2025 at 10:41:16AM +0800, Richard Zhu wrote:
> When wait for link up, both the link up and link down are normal
> results, not mistakes.
> Don't return error, since the results had been notified.

When waiting for the PCIe link to come up, both link up and link down are
valid results depending on the device state. Do not return an error, as
the outcome has already been reported in dw_pcie_wait_for_link().

Reviewed-by: Frank Li <Frank.Li@nxp.com>

>
> Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
> ---
>  drivers/pci/controller/dwc/pcie-designware-host.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
> index 228484e3ea4a..fe6997c9c1d5 100644
> --- a/drivers/pci/controller/dwc/pcie-designware-host.c
> +++ b/drivers/pci/controller/dwc/pcie-designware-host.c
> @@ -1108,9 +1108,7 @@ int dw_pcie_resume_noirq(struct dw_pcie *pci)
>  	if (ret)
>  		return ret;
>
> -	ret = dw_pcie_wait_for_link(pci);
> -	if (ret)
> -		return ret;
> +	dw_pcie_wait_for_link(pci);
>
>  	return ret;
>  }
> --
> 2.37.1
>