Re: [PATCH 3/4] ASoC: codecs: wsa884x: fix codec initialisation
From: Johan Hovold
Date: Fri Jan 02 2026 - 07:18:24 EST
On Fri, Jan 02, 2026 at 12:50:45PM +0100, Krzysztof Kozlowski wrote:
> On 02/01/2026 12:43, Johan Hovold wrote:
> > On Fri, Jan 02, 2026 at 12:31:21PM +0100, Krzysztof Kozlowski wrote:
> >> On 02/01/2026 12:14, Johan Hovold wrote:
> >>> The soundwire update_status() callback may be called multiple times with
> >>> the same ATTACHED status but initialisation should only be done when
> >>> transitioning from UNATTACHED to ATTACHED.
> >>>
> >>> Fix the inverted hw_init flag which was set to false instead of true
> >>> after initialisation which defeats its purpose and may result in
> >>> repeated unnecessary initialisation.
> > No, update_status() has:
> >
> > if (wsa884x->hw_init || status != SDW_SLAVE_ATTACHED)
> > return 0;
> >
> > ...
> >
> > wsa884x_init(wsa884x);
> >
> > so if you set hw_init to true then init is never called when status is
> > changed to ATTACHED.
>
> Uh, indeed, so this was supposed to be !wsa884x->hw_init... or indeed
> your meaning. This also means that this was never passing above if() and
> the init() was never called.
>
> regcache was probably synced via runtime PM, so at least that part worked.
>
> Did you test this driver on actual device how it affects the behavior?
No, I don't have a device that uses this codec anymore.
If you could give it a spin that would be great. It seems we have been
depending on reset values or an UNATTACHED => ATTACHED transition so
far.
Johan