]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
clk: sunxi-ng: mp: Fix dual-divider clock rate readback
authorChen-Yu Tsai <wens@csie.org>
Sat, 30 Aug 2025 17:08:56 +0000 (01:08 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Sep 2025 09:16:54 +0000 (11:16 +0200)
commit40108f69c372af3aea73e7829d6849a44638d662
tree16232791a6d1a061e2562b6f4d77d68719c3c677
parentf9fa006e35272c025fe587a067e9f9f87e8ea9fc
clk: sunxi-ng: mp: Fix dual-divider clock rate readback

commit 25fbbaf515acd13399589bd5ee6de5f35740cef2 upstream.

When dual-divider clock support was introduced, the P divider offset was
left out of the .recalc_rate readback function. This causes the clock
rate to become bogus or even zero (possibly due to the P divider being
1, leading to a divide-by-zero).

Fix this by incorporating the P divider offset into the calculation.

Fixes: 45717804b75e ("clk: sunxi-ng: mp: introduce dual-divider clock")
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Link: https://patch.msgid.link/20250830170901.1996227-4-wens@kernel.org
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/clk/sunxi-ng/ccu_mp.c