]> git.baikalelectronics.ru Git - kernel.git/commit
clk: bcm-2835: Remove rounding up the dividers
authorMaxime Ripard <maxime@cerno.tech>
Wed, 22 Sep 2021 12:54:16 +0000 (14:54 +0200)
committerMaxime Ripard <maxime@cerno.tech>
Mon, 25 Oct 2021 13:33:39 +0000 (15:33 +0200)
commit5744808e30f6af51c95d0c6e316a43704be057b7
treee28517bb0da59c4386deb525e3d9e06c2588bbba
parent94c58bcce4b3178cdec7a2ae6e9c3dc9552ddd93
clk: bcm-2835: Remove rounding up the dividers

The driver, once it found a divider, tries to round it up by increasing
the least significant bit of the fractional part by one when the
round_up argument is set and there's a remainder.

However, since it increases the divider it will actually reduce the
clock rate below what we were asking for, leading to issues with
clk_set_min_rate() that will complain that our rounded clock rate is
below the minimum of the rate.

Since the dividers are fairly precise already, let's remove that part so
that we can have clk_set_min_rate() working.

This is effectively a revert of da85c4baeb38 ("clk: bcm2835: add a round
up ability to the clock divisor").

Fixes: da85c4baeb38 ("clk: bcm2835: add a round up ability to the clock divisor")
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Acked-by: Stephen Boyd <sboyd@kernel.org>
Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Tested-by: Nicolas Saenz Julienne <nsaenz@kernel.org> # boot and basic functionality
Tested-by: Michael Stapelberg <michael@stapelberg.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20210922125419.4125779-3-maxime@cerno.tech
drivers/clk/bcm/clk-bcm2835.c