Skip to content

Commit e81361f

Browse files
Dong Aishengabelvesa
authored andcommitted
clk: imx: clk-scu: fix clk enable state save and restore
The scu clk_ops only inplements prepare() and unprepare() callback. Saving the clock state during suspend by checking clk_hw_is_enabled() is not safe as it's possible that some device drivers may only disable the clocks without unprepare. Then the state retention will not work for such clocks. Fixing it by checking clk_hw_is_prepared() which is more reasonable and safe. Fixes: d040963 ("clk: imx: scu: add suspend/resume support") Reviewed-by: Peng Fan <[email protected]> Tested-by: Carlos Song <[email protected]> Signed-off-by: Dong Aisheng <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Abel Vesa <[email protected]>
1 parent ff42796 commit e81361f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/clk/imx/clk-scu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ static int __maybe_unused imx_clk_scu_suspend(struct device *dev)
596596
clk->rate = clk_scu_recalc_rate(&clk->hw, 0);
597597
else
598598
clk->rate = clk_hw_get_rate(&clk->hw);
599-
clk->is_enabled = clk_hw_is_enabled(&clk->hw);
599+
clk->is_enabled = clk_hw_is_prepared(&clk->hw);
600600

601601
if (clk->parent)
602602
dev_dbg(dev, "save parent %s idx %u\n", clk_hw_get_name(clk->parent),

0 commit comments

Comments
 (0)