From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: broonie@kernel.org
Cc: lgirdwood@gmail.com, yung-chuan.liao@linux.intel.com,
pierre-louis.bossart@linux.dev, linux-sound@vger.kernel.org,
linux-kernel@vger.kernel.org, patches@opensource.cirrus.com
Subject: Re: [PATCH v2 3/3] ASoC: SDCA: Switch to fixup_controls callback for IRQ registration
Date: Thu, 16 Jul 2026 10:32:36 +0100 [thread overview]
Message-ID: <alilNHZXzlqGmARL@opensource.cirrus.com> (raw)
In-Reply-To: <20260715162918.1898396-4-ckeepax@opensource.cirrus.com>
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@opensource.cirrus.com>
> ---
>
> 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
prev parent reply other threads:[~2026-07-16 9:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-15 16:29 [PATCH v2 0/3] Fix races on creation of SDCA jack detection Charles Keepax
2026-07-15 16:29 ` [PATCH v2 1/3] ASoC: Add a component fixup_controls callback Charles Keepax
2026-07-15 16:29 ` [PATCH v2 2/3] ASoC: SDCA: Populate IRQ data earlier Charles Keepax
2026-07-15 16:29 ` [PATCH v2 3/3] ASoC: SDCA: Switch to fixup_controls callback for IRQ registration Charles Keepax
2026-07-16 9:32 ` Charles Keepax [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alilNHZXzlqGmARL@opensource.cirrus.com \
--to=ckeepax@opensource.cirrus.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=pierre-louis.bossart@linux.dev \
--cc=yung-chuan.liao@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox