Skip to content

Commit

Permalink
soc: imx: gpcv2: Assert reset before ungating clock
Browse files Browse the repository at this point in the history
[ Upstream commit df88005 ]

In case the power domain clock are ungated before the reset is asserted,
the system might freeze completely. This is likely due to a device is an
undefined state being attached to bus, which sporadically leads to a bus
hang. Assert the reset before the clock are enabled to assure the device
is in defined state before being attached to bus.

Fixes: fe58c88 ("soc: imx: gpcv2: add support for optional resets")
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Marek Vasut authored and gregkh committed Sep 15, 2022
1 parent 2a107bc commit 60a7ee2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/soc/imx/gpcv2.c
Expand Up @@ -333,14 +333,17 @@ static int imx_pgc_power_up(struct generic_pm_domain *genpd)
}
}

reset_control_assert(domain->reset);

/* Enable reset clocks for all devices in the domain */
ret = clk_bulk_prepare_enable(domain->num_clks, domain->clks);
if (ret) {
dev_err(domain->dev, "failed to enable reset clocks\n");
goto out_regulator_disable;
}

reset_control_assert(domain->reset);
/* delays for reset to propagate */
udelay(5);

if (domain->bits.pxx) {
/* request the domain to power up */
Expand Down

0 comments on commit 60a7ee2

Please sign in to comment.