Re: [PATCH v6 3/7] clk: introduce new helper clk_hw_get_children_lcm() to calculate LCM of all child rates

From: Maxime Ripard

Date: Thu Mar 19 2026 - 05:17:16 EST


Hi,

On Fri, Mar 13, 2026 at 12:43:10PM -0400, Brian Masney wrote:
> Introduce a new helper that recursively walks through all children and
> their descendants, calculating the lowest common multiple (LCM) of their
> rates. For the requesting child, it uses the requested rate; for other
> children, it uses their current rate. This is useful for determining
> what parent rate can satisfy all children through simple integer
> dividers.
>
> Link: https://lore.kernel.org/linux-clk/aUSWU7UymULCXOeF@xxxxxxxxxx/
> Link: https://lpc.events/event/19/contributions/2152/
> Signed-off-by: Brian Masney <bmasney@xxxxxxxxxx>

Reviewed-by: Maxime Ripard <mripard@xxxxxxxxxx>

Somewhat related: we probably want to do the same with the highest
common divider for multipliers.

Maxime

Attachment: signature.asc
Description: PGP signature