[PATCH v8 phy-next 01/31] PCI: cadence: Preserve all error codes in cdns_plat_pcie_probe()
Bjorn Helgaas
helgaas at kernel.org
Tue May 5 09:26:29 PDT 2026
[+cc Tom, author of bd22885aa188 in case there's something subtle here]
On Tue, May 05, 2026 at 01:04:53PM +0300, Vladimir Oltean wrote:
> The blamed commit functionally changed the error path of
> cdns_pcie_host_probe(), now cdns_plat_pcie_probe().
>
> When the old code path executed "goto err_get_sync", the PCIe controller
> probe function propagated the pm_runtime_get_sync() error code. The new
> code doesn't, and returns 0.
>
> Similarly for the "goto err_init" previously triggered by
> cdns_pcie_host_init() errors, and now triggered by
> cdns_pcie_host_setup() and cdns_pcie_ep_setup() errors. These are not
> propagated and will result in probing success, which is incorrect.
>
> Fixes: bd22885aa188 ("PCI: cadence: Refactor driver to use as a core library")
> Signed-off-by: Vladimir Oltean <vladimir.oltean at nxp.com>
> ---
> Cc: Bjorn Helgaas <bhelgaas at google.com>
> Cc: "Krzysztof Wilczyński" <kwilczynski at kernel.org>
> Cc: Lorenzo Pieralisi <lpieralisi at kernel.org>
> Cc: Manikandan K Pillai <mpillai at cadence.com>
> Cc: Manivannan Sadhasivam <mani at kernel.org>
> Cc: Rob Herring <robh at kernel.org>
I guess this driver is orphaned.
Acked-by: Bjorn Helgaas <bhelgaas at google.com>
> v7->v8: patch is new, issue was flagged by Sashiko
> https://sashiko.dev/#/patchset/20260430110652.558622-1-vladimir.oltean@nxp.com
> ---
> drivers/pci/controller/cadence/pcie-cadence-plat.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pci/controller/cadence/pcie-cadence-plat.c b/drivers/pci/controller/cadence/pcie-cadence-plat.c
> index b067a3296dd3..8b12a46b5601 100644
> --- a/drivers/pci/controller/cadence/pcie-cadence-plat.c
> +++ b/drivers/pci/controller/cadence/pcie-cadence-plat.c
> @@ -126,7 +126,7 @@ static int cdns_plat_pcie_probe(struct platform_device *pdev)
> while (phy_count--)
> device_link_del(cdns_plat_pcie->pcie->link[phy_count]);
>
> - return 0;
> + return ret;
This affects cases where pm_runtime_get_sync(),
cdns_pcie_host_setup(), or cdns_pcie_ep_setup() return failure.
Seems right to me to fail the probe when these fail.
Not all users of pm_runtime_get_sync() check for failure, but I think
all the other controller drivers that do check return failures from
the .probe().
> }
>
> static void cdns_plat_pcie_shutdown(struct platform_device *pdev)
> --
> 2.34.1
>
More information about the linux-arm-kernel
mailing list