Re: [PATCH v2 3/3] ASoC: SDCA: Switch to fixup_controls callback for IRQ registration
From: Charles Keepax
Date: Thu Jul 16 2026 - 05:34:16 EST
On Wed, Jul 15, 2026 at 05:29:18PM +0100, Charles Keepax wrote:
> Currently there are some race conditions around the boot of SDCA
> jack detection. The core creates DAPM widgets/routes quite a
> long time before it creates the associated ALSA control, and
> the jack detection IRQ is currently registered in component
> probe. At the time of component probe, the DAPM widgets exist,
> shortly after this the DAPM routes are added. At the time the DAPM
> routes are added the register value for the control is checked
> and the appropriate path is connected. The existing handling
> in the SDCA jack IRQ handles the case the control doesn't exist
> and updates the registers directly, which works until the DAPM
> routes are added. After the routes are added the DAPM graph has
> already set connected on a particular DAPM path, which will not
> be updated until an IRQ is received when the control is present.
> Thus those updated are usually not reflected in the resulting
> DAPM graph which can lead to the audio path being erroneously
> powered on/off.
>
> Switch to the new fixup_controls callback to register the
> IRQs, this is guaranteed to run after all the controls have
> been created. Which means we can avoid the aforementioned race
> condition and as a bonus no longer need to concern ourselves
> with a case where the IRQ handler runs and the ALSA control
> is unavailable.
>
> Signed-off-by: Charles Keepax <ckeepax@xxxxxxxxxxxxxxxxxxxxx>
> ---
>
> Changes since v1:
> - Remove the bus remove callback since all the IRQs are freed in
> component remove and the memory is devm managed.
Sigh... very sorry I shouldn't have removed that. It is needed to
free the FDL IRQ if component remove never ran. Will do a little
more thinking and send a v3.
Thanks,
Charles