Re: [PATCH 0/5] clk: Use v2 rate calculation on i.MX8MP

From: Brian Masney

Date: Wed Oct 21 2026 - 10:12:49 EST


Hi Miquel (and Jerome),

On Wed, Oct 21, 2026 at 03:09:56PM +0200, Miquel Raynal wrote:
> Hello,
>
> Thanks to Brian's series, we can finally solve the problem of rate
> calculation faced with the i.MX8MP LDB/PIX clocks. I've tested this
> series using a v7.1 mainline kernel with a lot of unrelated DRM
> patches. I then re-applied it on top of clk-next after fixing the few
> conflicts when applying Brian's series, but that means I cannot (yet)
> run a 7.2/7.3 kernel on the platform (and applying this series with b4
> will fail due to Brian's series no longer applying on top of clk-next).
>
> The DTS patch is there for reference, I don't mind if it's not picked
> up.
>
> Signed-off-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>

Thanks for testing and posting this!

I know that Jerome would like to see some changes to my rate change
series before it can be merged. I'm going to probably poorly describe
his concerns here, so apologies in advance if I miscommunicate this
Jerome. I'd appreciate it if you could clarify.

- Currently the latest version posted (v8) to the list has the LCM
helper (clk_hw_get_children_lcm) in drivers/clk/clk.c, and the LCM
helper should be in clk-divider.c. I agree that it should be in the
divider code, but we'd have to export some additional APIs to allow
that. In the future if we went with what's in v8, and wanted to fix
the fractional dividers, then it would need a similar type of helper
in clk.c, which is not ideal. I initially went with this approach to
limit the APIs that are exported from the clk core.

- I have a draft v9 series that I haven't posted yet that adds two new
helpers: clk_hw_get_num_children() and clk_hw_get_child_by_index()
similar to the existing functions for the parents. This allows moving
the LCM logic into clk-divider.c where it belongs, however the
downside to this approach is that it expands the clk exported APIs so
that providers will be able to fully walk the clk tree. The concern is
that providers may abuse this in the future and it may limit future
changes / cleanups to the clk core. For example, if we wanted to clean
up the way locking is done, this may potentially limit the available
options.
https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git/log/?h=clk-divider-scaling-v9

- He would like to see it where each clk consumer sets the min/max rate
that's acceptable, and the clk scaling in the provider takes those
ranges into account when rates are negotiated.

Anyways, please chime in Jerome if I got this right / wrong, and any
additional concerns.

Brian