Re: [PATCH v2 2/3] clk: divider: Fix round-closest for rates above the parent rate

From: Brian Masney

Date: Mon Nov 16 2026 - 16:17:48 EST


> When the requested rate is above the parent rate, _div_round_closest()
> computes a down divider of 0 and divides the parent rate by it. Asking a
> CLK_DIVIDER_ROUND_CLOSEST divider without CLK_SET_RATE_PARENT for its
> maximum rate with clk_round_rate(clk, ULONG_MAX) then traps on x86.
>
> No divider goes above the parent rate, so the smallest one is the
> closest. Return it before dividing.
>
> Fixes: 26bac95aa88c ("clk: divider: fix selection of divider when rounding to closest")
> Signed-off-by: Carlo Caione <ccaione@xxxxxxxxxxxx>

Reviewed-by: Brian Masney <masneyb@xxxxxxxxxx>

--
Brian Masney <masneyb@xxxxxxxxxx>