[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<SEZPR06MB6959882F5DA673456A3AA85D96202@SEZPR06MB6959.apcprd06.prod.outlook.com>
Date: Thu, 7 Mar 2024 19:18:05 +0800
From: Yang Xiwen <forbidden405@...look.com>
To: Maxime Ripard <mripard@...nel.org>
Cc: Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>, linux-clk@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] clk: set initial best mux parent to current parent
with CLK_MUX_ROUND_CLOSEST
On 3/7/2024 4:48 PM, Maxime Ripard wrote:
> Hi,
>
> On Thu, Mar 07, 2024 at 10:03:50AM +0800, Yang Xiwen via B4 Relay wrote:
>> From: Yang Xiwen <forbidden405@...look.com>
>>
>> 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@...look.com>
> 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.
I think the current behavior is odd but conforms to the document if
CLK_MUX_ROUND_CLOSEST is not specified. If i understand correctly, the
default behavior of mux clocks is to select the closest rate lower than
requested rate, and CLK_MUX_ROUND_CLOSEST removes the "lower than"
limitation, which is what this version tries to accomplish.
>
> And again, either way, we should document it. And run it through kernelci.
>
> Maxime
--
Regards,
Yang Xiwen
Powered by blists - more mailing lists