Re: [PATCH v3] clk: set initial best mux parent to current parent with CLK_MUX_ROUND_CLOSEST

From: Maxime Ripard
Date: Thu Mar 07 2024 - 03:48:21 EST


Hi,

On Thu, Mar 07, 2024 at 10:03:50AM +0800, Yang Xiwen via B4 Relay wrote:
> From: Yang Xiwen <forbidden405@xxxxxxxxxxx>
>
> Originally, the initial clock rate is hardcoded to 0, this can lead to
> some problem when setting a very small rate with CLK_MUX_ROUND_CLOSEST.
>
> For example, if the lowest possible rate provided by the mux is 1000Hz,
> setting a rate below 500Hz will fail, because no clock can provide a
> better rate than the non-existant 0Hz. But it should succeed with 1000Hz
> being set.
>
> Setting the initial best parent to current parent could solve this bug.
>
> Signed-off-by: Yang Xiwen <forbidden405@xxxxxxxxxxx>

I don't think it would be the way to go. The biggest issue to me is that
it's inconsistent, and only changing the behaviour for a given flag
doesn't solve that.

And again, either way, we should document it. And run it through kernelci.

Maxime

Attachment: signature.asc
Description: PGP signature