[PATCH v3 3/4] pci: pcie_dw_rockchip: drop clk_release_bulk calls
Daniele Briguglio
hello at superkali.me
Wed May 20 08:05:29 CEST 2026
clk_release_bulk() loops clk_disable() over the bulk; the bulk
array itself is devm_kcalloc()-allocated and freed at device
detach, so the function does not actually release memory.
In parse_dt() the clocks are acquired but never enabled, so the
existing call disables clocks that are off. In probe() after
init_port() failure, the inner err_disable_clks: path added in
the previous patch has already balanced clk_enable_bulk() with
clk_disable_bulk(), so the outer call is a double-disable.
With the new gated-fixed-clock driver both cases trigger
regulator_set_enable_if_allowed(false) on regulators that were
either never enabled or just disabled, desynchronising the
regulator enable_count. On rk3588-rock-5-itx with only one M.2
slot populated, the failing empty slot would decrement the
enable_count of the still-needed regulator twice and pull power
from the populated slot.
Suggested-by: Jonas Karlman <jonas at kwiboo.se>
Signed-off-by: Daniele Briguglio <hello at superkali.me>
---
drivers/pci/pcie_dw_rockchip.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/pci/pcie_dw_rockchip.c b/drivers/pci/pcie_dw_rockchip.c
index 8ea51e642..c1e34df53 100644
--- a/drivers/pci/pcie_dw_rockchip.c
+++ b/drivers/pci/pcie_dw_rockchip.c
@@ -425,7 +425,7 @@ static int rockchip_pcie_parse_dt(struct udevice *dev)
rockchip_pcie_parse_dt_err_phy_get_by_index:
/* regulators don't need release */
rockchip_pcie_parse_dt_err_supply_regulator:
- clk_release_bulk(&priv->clks);
+ /* clocks don't need release */
rockchip_pcie_parse_dt_err_clk_get_bulk:
reset_release_bulk(&priv->rsts);
rockchip_pcie_parse_dt_err_reset_get_bulk:
@@ -476,7 +476,6 @@ static int rockchip_pcie_probe(struct udevice *dev)
return ret;
rockchip_pcie_probe_err_init_port:
- clk_release_bulk(&priv->clks);
reset_release_bulk(&priv->rsts);
dm_gpio_free(dev, &priv->rst_gpio);
--
2.47.3
More information about the U-Boot
mailing list