diff options
author | Maxime Ripard <mripard@kernel.org> | 2023-10-12 11:37:29 +0300 |
---|---|---|
committer | Stephen Boyd <sboyd@kernel.org> | 2023-10-13 03:30:54 +0300 |
commit | 601cb6d573facde5fc88efa935b074da64ae63c9 (patch) | |
tree | 888ca5652a116a3c1415b9e7886fb5cf70d51fe7 /drivers/clk/clk.c | |
parent | a47b44fbb13f5e7a981b4515dcddc93a321ae89c (diff) | |
download | linux-601cb6d573facde5fc88efa935b074da64ae63c9.tar.xz |
clk: socfpga: gate: Account for the divider in determine_rate
Commit 9607beb917df ("clk: socfpga: gate: Add a determine_rate hook")
added a determine_rate implementation set to the
clk_hw_determine_rate_no_reparent, but failed to account for the
internal divider that wasn't used before anywhere but in recalc_rate.
This led to inconsistencies between the clock rate stored in
clk_core->rate and the one returned by clk_round_rate() that leverages
determine_rate().
Since that driver seems to be widely used (and thus regression-prone)
and not supporting rate changes (since it's missing a .set_rate
implementation), we can just report the current divider programmed in
the clock but not try to change it in any way.
This should be good enough to fix the issues reported, and if someone
ever wants to allow the divider to change then it should be easy enough
using the clk-divider helpers.
Link: https://lore.kernel.org/linux-clk/20231005095927.12398-2-b.spranger@linutronix.de/
Fixes: 9607beb917df ("clk: socfpga: gate: Add a determine_rate hook")
Reported-by: Benedikt Spranger <b.spranger@linutronix.de>
Signed-off-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20231012083729.2148044-1-mripard@kernel.org
[sboyd@kernel.org: Fix hw -> hwclk]
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/clk.c')
0 files changed, 0 insertions, 0 deletions