]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
clk: clocking-wizard: Fix the round rate handling for versal
authorShubhrajyoti Datta <shubhrajyoti.datta@amd.com>
Wed, 25 Jun 2025 05:41:14 +0000 (11:11 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Aug 2025 14:39:12 +0000 (16:39 +0200)
[ Upstream commit 7f5e9ca0a424af44a708bb4727624d56f83ecffa ]

Fix the `clk_round_rate` implementation for Versal platforms by calling
the Versal-specific divider calculation helper. The existing code used
the generic divider routine, which results in incorrect round rate.

Fixes: 7681f64e6404 ("clk: clocking-wizard: calculate dividers fractional parts")
Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@amd.com>
Link: https://lore.kernel.org/r/20250625054114.28273-1-shubhrajyoti.datta@amd.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/xilinx/clk-xlnx-clock-wizard.c

index bbf7714480e7b721751399a513a861c9bb2bcf40..0295a13a811cf8e00fd49879eefc5bcf4fb89228 100644 (file)
@@ -669,7 +669,7 @@ static long clk_wzrd_ver_round_rate_all(struct clk_hw *hw, unsigned long rate,
        u32 m, d, o, div, f;
        int err;
 
-       err = clk_wzrd_get_divisors(hw, rate, *prate);
+       err = clk_wzrd_get_divisors_ver(hw, rate, *prate);
        if (err)
                return err;