summaryrefslogtreecommitdiffstats
path: root/drivers/clk
diff options
context:
space:
mode:
authorDinh Nguyen <dinguyen@kernel.org>2018-12-17 18:06:14 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-01-31 08:14:34 +0100
commitcf8ea8d536a4db6f04f8c2ca06ad0a94f45042d7 (patch)
tree331663bc8e837c8717df19b63a921398c6647086 /drivers/clk
parent0af64fda917df00a8d199f7635e20a06acd2a3b7 (diff)
downloadlinux-stable-cf8ea8d536a4db6f04f8c2ca06ad0a94f45042d7.tar.gz
linux-stable-cf8ea8d536a4db6f04f8c2ca06ad0a94f45042d7.tar.bz2
linux-stable-cf8ea8d536a4db6f04f8c2ca06ad0a94f45042d7.zip
clk: socfpga: stratix10: fix rate calculation for pll clocks
commit c0a636e4cc2eb39244d23c0417c117be4c96a7fe upstream. The main PLL calculation has a mistake. We should be using the multiplying the VCO frequency, not the parent clock frequency. Fixes: 07afb8db7340 ("clk: socfpga: stratix10: add clock driver for Stratix10 platform") Cc: linux-stable@vger.kernel.org Signed-off-by: Dinh Nguyen <dinguyen@kernel.org> Signed-off-by: Stephen Boyd <sboyd@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/clk')
-rw-r--r--drivers/clk/socfpga/clk-pll-s10.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/clk/socfpga/clk-pll-s10.c b/drivers/clk/socfpga/clk-pll-s10.c
index 2d5d8b43727e..c4d0b6f6abf2 100644
--- a/drivers/clk/socfpga/clk-pll-s10.c
+++ b/drivers/clk/socfpga/clk-pll-s10.c
@@ -43,7 +43,7 @@ static unsigned long clk_pll_recalc_rate(struct clk_hw *hwclk,
/* Read mdiv and fdiv from the fdbck register */
reg = readl(socfpgaclk->hw.reg + 0x4);
mdiv = (reg & SOCFPGA_PLL_MDIV_MASK) >> SOCFPGA_PLL_MDIV_SHIFT;
- vco_freq = (unsigned long long)parent_rate * (mdiv + 6);
+ vco_freq = (unsigned long long)vco_freq * (mdiv + 6);
return (unsigned long)vco_freq;
}