Patch "clk: imx: clk-scu: fix clk enable state save and restore" has been added to the 6.6-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    clk: imx: clk-scu: fix clk enable state save and restore

to the 6.6-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     clk-imx-clk-scu-fix-clk-enable-state-save-and-restor.patch
and it can be found in the queue-6.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 61b4b0c886a6ec0b1693352d3474cddadf290e0b
Author: Dong Aisheng <aisheng.dong@xxxxxxx>
Date:   Sun Oct 27 20:00:10 2024 +0800

    clk: imx: clk-scu: fix clk enable state save and restore
    
    [ Upstream commit e81361f6cf9bf4a1848b0813bc4becb2250870b8 ]
    
    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: d0409631f466 ("clk: imx: scu: add suspend/resume support")
    Reviewed-by: Peng Fan <peng.fan@xxxxxxx>
    Tested-by: Carlos Song <carlos.song@xxxxxxx>
    Signed-off-by: Dong Aisheng <aisheng.dong@xxxxxxx>
    Link: https://lore.kernel.org/r/20241027-imx-clk-v1-v3-4-89152574d1d7@xxxxxxx
    Signed-off-by: Abel Vesa <abel.vesa@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/clk/imx/clk-scu.c b/drivers/clk/imx/clk-scu.c
index cd83c52e9952a..564f549ec204f 100644
--- a/drivers/clk/imx/clk-scu.c
+++ b/drivers/clk/imx/clk-scu.c
@@ -594,7 +594,7 @@ static int __maybe_unused imx_clk_scu_suspend(struct device *dev)
 		clk->rate = clk_scu_recalc_rate(&clk->hw, 0);
 	else
 		clk->rate = clk_hw_get_rate(&clk->hw);
-	clk->is_enabled = clk_hw_is_enabled(&clk->hw);
+	clk->is_enabled = clk_hw_is_prepared(&clk->hw);
 
 	if (clk->parent)
 		dev_dbg(dev, "save parent %s idx %u\n", clk_hw_get_name(clk->parent),




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux