[PATCH] spi: meson-spicc: save pow2 datarate between messages
Neil Armstrong
narmstrong at baylibre.com
Wed Aug 10 08:51:33 PDT 2022
On 10/08/2022 16:49, Mark Brown wrote:
> On Wed, Aug 10, 2022 at 04:40:04PM +0200, Neil Armstrong wrote:
>
>> I don't think it's worth adding so much code for this since we already
>
> I don't recall the code for clock providers being that hard? They're
> generally pretty small, some of the ASoC CODEC drivers did something
> similar.
Seems over-engineering to me, but I can explore this path if it's the best
route to follow.
>
>> had an open-coded function which perfectly worked before.
>
> Except in the cases it didn't...
It did but wasn't generic enough to take the new clock path introduced
in the new SoCs.
>
>> I'm perfectly OK to remove the CCF driver for the legacy clock path
>> and return back to the old open coded calculation since it perfectly
>> worked and stop using the legacy clock path for new SoCs since it would
>> never be selected anyway...
>
> It does seem better to go the clock provider route TBH.
I'm afraid this won't fix the problem since CCF won't set the clock again
if the rate is already ok in it's cache, we'd still need to save the divider
value and restore it after the reset as I did on this exact patch.
>
>> ... but GX SoCs are broken so it would need an intermediate fix until
>> I push the refactoring to cleanup all this.
>
> I'm trying to figure out if this is actually fixing the problem or just
> papering over one case where things happened to go badly.
It does, when clk_set_rate() is called, the datarate field would be the
same as after the previous call.
Neil
More information about the linux-amlogic
mailing list