[PATCH v2 06/15] PCI: rcar-gen4: Assert resets when Gen5 PHY initialization fails
From: Koichiro Den
Date: Mon Sep 28 2026 - 13:00:15 EST
common_init() enables the clocks and deasserts the power and
Application/Local resets before phy_init(). If phy_init() fails, the
error path only disables the clocks, leaving those resets deasserted.
Assert both resets before disabling the clocks to unwind the completed
common initialization.
Signed-off-by: Koichiro Den <den@xxxxxxxxxxxxx>
---
Changes in v2:
- New patch. Place the fix(?) before the initialization refactoring.
Marek, I looked through v1-v5 of your X5H series, but I'm not yet sure,
was there a specific reason to leave resets deasserted when phy_init()
fails? If not, this fixes the unwind before the restructuring in the
following patches.
drivers/pci/controller/dwc/pcie-rcar-gen4.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci/controller/dwc/pcie-rcar-gen4.c b/drivers/pci/controller/dwc/pcie-rcar-gen4.c
index f9241ec0f116..75e74fe3889d 100644
--- a/drivers/pci/controller/dwc/pcie-rcar-gen4.c
+++ b/drivers/pci/controller/dwc/pcie-rcar-gen4.c
@@ -381,7 +381,7 @@ static int rcar_gen5_pcie_init(struct rcar_gen4_pcie *rcar)
return 0;
err_unprepare:
- clk_bulk_disable_unprepare(DW_PCIE_NUM_CORE_CLKS, dw->core_clks);
+ rcar_gen4_pcie_common_deinit(rcar);
return ret;
}
--
2.51.0