Patch "clk: imx: clk-fracn-gppll: Return rate in rate table properly in ->recalc_rate()" has been added to the 5.18-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-fracn-gppll: Return rate in rate table properly in ->recalc_rate()

to the 5.18-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-fracn-gppll-return-rate-in-rate-table-pr.patch
and it can be found in the queue-5.18 subdirectory.

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



commit d341a919e4f44e63b435f761c954e782d44b9f95
Author: Liu Ying <victor.liu@xxxxxxx>
Date:   Thu Jun 9 21:29:00 2022 +0800

    clk: imx: clk-fracn-gppll: Return rate in rate table properly in ->recalc_rate()
    
    [ Upstream commit 5ebaf9f7da5bb2dc56d394eabfcbe46dc6b1ea8d ]
    
    The PLL parameters in rate table should be directly compared with
    those read from PLL registers instead of the cooked ones.
    
    Fixes: 1b26cb8a77a4 ("clk: imx: support fracn gppll")
    Cc: Abel Vesa <abel.vesa@xxxxxxx>
    Cc: Michael Turquette <mturquette@xxxxxxxxxxxx>
    Cc: Stephen Boyd <sboyd@xxxxxxxxxx>
    Cc: Shawn Guo <shawnguo@xxxxxxxxxx>
    Cc: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
    Cc: Pengutronix Kernel Team <kernel@xxxxxxxxxxxxxx>
    Cc: Fabio Estevam <festevam@xxxxxxxxx>
    Cc: NXP Linux Team <linux-imx@xxxxxxx>
    Cc: Peng Fan <peng.fan@xxxxxxx>
    Signed-off-by: Liu Ying <victor.liu@xxxxxxx>
    Reviewed-by: Peng Fan <peng.fan@xxxxxxx>
    Reviewed-by: Abel Vesa <abel.vesa@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20220609132902.3504651-6-peng.fan@xxxxxxxxxxx
    Signed-off-by: Abel Vesa <abel.vesa@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/clk/imx/clk-fracn-gppll.c b/drivers/clk/imx/clk-fracn-gppll.c
index 36a53c60e71f..cb06b0045e9e 100644
--- a/drivers/clk/imx/clk-fracn-gppll.c
+++ b/drivers/clk/imx/clk-fracn-gppll.c
@@ -131,18 +131,7 @@ static unsigned long clk_fracn_gppll_recalc_rate(struct clk_hw *hw, unsigned lon
 	mfi = FIELD_GET(PLL_MFI_MASK, pll_div);
 
 	rdiv = FIELD_GET(PLL_RDIV_MASK, pll_div);
-	rdiv = rdiv + 1;
 	odiv = FIELD_GET(PLL_ODIV_MASK, pll_div);
-	switch (odiv) {
-	case 0:
-		odiv = 2;
-		break;
-	case 1:
-		odiv = 3;
-		break;
-	default:
-		break;
-	}
 
 	/*
 	 * Sometimes, the recalculated rate has deviation due to
@@ -160,6 +149,19 @@ static unsigned long clk_fracn_gppll_recalc_rate(struct clk_hw *hw, unsigned lon
 	if (rate)
 		return (unsigned long)rate;
 
+	rdiv = rdiv + 1;
+
+	switch (odiv) {
+	case 0:
+		odiv = 2;
+		break;
+	case 1:
+		odiv = 3;
+		break;
+	default:
+		break;
+	}
+
 	/* Fvco = Fref * (MFI + MFN / MFD) */
 	fvco = fvco * mfi * mfd + fvco * mfn;
 	do_div(fvco, mfd * rdiv * odiv);



[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