linux/drivers/clk/meson
Martin Blumenstingl 800ffac107 clk: meson: mpll: use 64-bit maths in params_from_rate
[ Upstream commit 86aacdca66 ]

"rem * SDM_DEN" can easily overflow on the 32-bit Meson8 and Meson8b
SoCs if the "remainder" (after the division operation) is greater than
262143Hz. This is likely to happen since the input clock for the MPLLs
on Meson8 and Meson8b is "fixed_pll", which is running at a rate of
2550MHz.

One example where this was observed to be problematic was the Ethernet
clock calculation (which takes MPLL2 as input). When requesting a rate
of 125MHz there is a remainder of 2500000Hz.
The resulting MPLL2 rate before this patch was 127488329Hz.
The resulting MPLL2 rate after this patch is 124999103Hz.

Commit b609338b26 ("clk: meson: mpll: use 64bit math in
rate_from_params") already fixed a similar issue in rate_from_params.

Fixes: 007e6e5c5f ("clk: meson: mpll: add rw operation")
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2018-04-12 12:32:11 +02:00
..
clk-audio-divider.c clk: meson: add audio clock divider support 2017-04-07 16:50:44 +02:00
clk-cpu.c clk: meson8b: clean up cpu clocks 2016-06-22 18:02:35 -07:00
clk-mpll.c clk: meson: mpll: use 64-bit maths in params_from_rate 2018-04-12 12:32:11 +02:00
clk-pll.c clk: meson: Add support for parameters for specific PLLs 2017-04-04 12:05:12 -07:00
clkc.h clk: meson: mpll: fix mpll0 fractional part ignored 2017-08-01 14:18:31 +02:00
gxbb-aoclk-32k.c clk: meson: gxbb-aoclk: Add CEC 32k clock 2017-08-04 18:02:02 +02:00
gxbb-aoclk-regmap.c clk: meson: gxbb-aoclk: Switch to regmap for register access 2017-08-04 18:02:01 +02:00
gxbb-aoclk.c clk: meson: gxbb-aoclk: Add CEC 32k clock 2017-08-04 18:02:02 +02:00
gxbb-aoclk.h clk: meson: gxbb-aoclk: Add CEC 32k clock 2017-08-04 18:02:02 +02:00
gxbb.c clk: meson: gxbb: fix wrong clock for SARADC/SANA 2018-03-19 08:42:48 +01:00
gxbb.h clk: meson: gxbb: Add sd_emmc clk0 clkids 2017-08-04 17:49:34 +02:00
Kconfig clk: meson: meson8b: register the built-in reset controller 2017-08-04 18:01:58 +02:00
Makefile clk: meson: gxbb-aoclk: Add CEC 32k clock 2017-08-04 18:02:02 +02:00
meson8b.c Amlogic clock driver updates for 4.14 2017-08-23 15:28:52 -07:00
meson8b.h clk: meson: meson8b: register the built-in reset controller 2017-08-04 18:01:58 +02:00