soc: imx: gpcv2: Assert reset before ungating clock
PATCH v3 1/1 soc: imx: gpcv2: Assert reset before ungating clock
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.
---
Cc: Fabio Estevam <[email protected]>
Cc: Frieder Schrempf <[email protected]>
Cc: Lucas Stach <[email protected]>
Cc: NXP Linux Team <[email protected]>
Cc: Peng Fan <[email protected]>
Cc: Shawn Guo <[email protected]>
To: [email protected]
---
V2: - Always assert the reset before enabling clock
- Update commit message
- Add Fixes tag
V3: Move the extra delay past clk_prepare_enable()
--- drivers/soc/imx/gpcv2.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/soc/imx/gpcv2.c +4 -1
@@ -335,6 +335,8 @@ 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) {
@@ -342,7 +344,8 @@ static int imx_pgc_power_up(struct generic_pm_domain *genpd) 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 */
Signature · 7 lines
2.35.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Hi Marek,
Quoted 8 lines · Marek Vasut
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 fe58c887fb8ca ("soc: imx: gpcv2: add support for optional resets")Signed-off-by Marek Vasut <[email protected]>
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Am Freitag, dem 12.08.2022 um 19:08 +0200 schrieb Marek Vasut:
Quoted 8 lines
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 fe58c887fb8ca ("soc: imx: gpcv2: add support for optional resets")Signed-off-by Marek Vasut <[email protected]>
Quoted 31 lines
---
Cc: Fabio Estevam <[email protected]>
Cc: Frieder Schrempf <[email protected]>
Cc: Lucas Stach <[email protected]>
Cc: NXP Linux Team <[email protected]>
Cc: Peng Fan <[email protected]>
Cc: Shawn Guo <[email protected]>
To: [email protected]
---
V2: - Always assert the reset before enabling clock
- Update commit message
- Add Fixes tag
V3: Move the extra delay pastclk_prepare_enable()--- drivers/soc/imx/gpcv2.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/soc/imx/gpcv2.c +2
-0@@ -335,6 +335,8 @@ 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) {
drivers/soc/imx/gpcv2.c static int imx_pgc_power_up(struct generic_pm_domain *genpd) · line 351
Quoted 9 lines
drivers/soc/imx/gpcv2.c +2
-1@@ -342,7 +344,8 @@ static int imx_pgc_power_up(struct generic_pm_domain *genpd) 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 */
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Shawn Guo
AppliedQuoted 8 lines · Marek Vasut
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 fe58c887fb8ca ("soc: imx: gpcv2: add support for optional resets")Signed-off-by Marek Vasut <[email protected]>
Applied, thanks!
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel