[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <45116f61-6ee7-919c-7c99-704a5b274df8@sberdevices.ru>
Date: Mon, 24 Jul 2023 18:15:14 +0300
From: Martin Kurbanov <mmkurbanov@...rdevices.ru>
To: Mark Brown <broonie@...nel.org>
CC: Jerome Brunet <jbrunet@...libre.com>,
Neil Armstrong <neil.armstrong@...aro.org>,
Andy Shevchenko <andy.shevchenko@...il.com>,
<linux-spi@...r.kernel.org>, <linux-amlogic@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, <kernel@...rdevices.ru>
Subject: Re: [PATCH v2 2/2] spi: amlogic-spifc-a1: add support for
max_speed_hz
On 20.07.2023 18:46, Mark Brown wrote:
> On Thu, Jul 20, 2023 at 06:41:11PM +0300, Martin Kurbanov wrote:
>> On 11.07.2023 10:25, Jerome Brunet wrote:
>
>>>> + ret = clk_set_rate(spifc->clk, freq);
>>>> + if (ret)
>>>> + return ret;
>
>>>> + spifc->curr_speed_hz = freq;
>
>>> There is no guarantee that clk_set_rate() has set the rate you have
>>> requested, at least not precisely. You should call clk_get_rate() here.
>
>> Are you referring to a situation where there is a change in the rate due
>> to a request from another client, such as a sibling driver with the same
>> parent clock?
>
> The clock may simply not be able to generate exactly the rate you
> requested, the rate will be rounded to some value that the clock can
> actually generate.
Yes, I understand the situation. However, I am comparing it with the
requested frequency rather than the actual one that has been set.
Therefore, I asked Jerome for clarification regarding whether the
frequency can be changed by another client (driver). Maybe, it's better
to remove this condition at all? CCF has a cached rate value and doesn't
run 'set' operation if it's not needed.
--
Best Regards,
Martin Kurbanov
Powered by blists - more mailing lists