Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: socfpga: stratix10: fix rate calculation for pll clocks

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>

authored by

Dinh Nguyen and committed by
Stephen Boyd
c0a636e4 83b4c147

+1 -1
+1 -1
drivers/clk/socfpga/clk-pll-s10.c
··· 43 43 /* Read mdiv and fdiv from the fdbck register */ 44 44 reg = readl(socfpgaclk->hw.reg + 0x4); 45 45 mdiv = (reg & SOCFPGA_PLL_MDIV_MASK) >> SOCFPGA_PLL_MDIV_SHIFT; 46 - vco_freq = (unsigned long long)parent_rate * (mdiv + 6); 46 + vco_freq = (unsigned long long)vco_freq * (mdiv + 6); 47 47 48 48 return (unsigned long)vco_freq; 49 49 }