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, shumingf@realtek.com,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
patches@opensource.cirrus.com
Subject: [PATCH v4 0/7] Fix races on creation of SDCA jack detection
Date: Tue, 21 Jul 2026 15:36:29 +0100 [thread overview]
Message-ID: <20260721143636.361814-1-ckeepax@opensource.cirrus.com> (raw)
Currently there exists a couple races that can result in the DAPM graph
coming up in a state that doesn't match the hardware with respect to
SDCA jack detection. This series fixes these up by adding a component
level fixup_controls helper into the asoc core and shuffling around the
IRQ requests from the SDCA side.
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 updates are
usually not reflected in the resulting DAPM graph which can lead
to the audio path being erroneously powered on/off.
Thanks,
Charles
Changes since v1:
- Clean up freeing of the interrupt name, Sashiko astutely pointed out
there was a memory leak there.
Changes since v2:
- Add back bus remove in the class driver, and split the IRQ free into
two functions.
Changes since v3:
- Renamed sdca_irq_allocate to make more clear it uses devm.
- Added description of the race onto this cover-letter as well.
- Removed devm usage from all the primary IRQ requesting, although it
is still used for the IRQ struct allocation.
- Added one more fix to move the kcontrol search out of the IRQ.
Charles Keepax (7):
ASoC: SDCA: Rename sdca_irq_allocate() to include devm
ASoC: SDCA: Add sdca_irq_cleanup_late()
ASoC: SDCA: Remove devm from primary IRQ cleanup
ASoC: SDCA: Populate IRQ data earlier
ASoC: Add a component fixup_controls callback
ASoC: SDCA: Switch to fixup_controls callback for IRQ registration
ASoC: SDCA: Move kcontrol search out of IRQ
include/sound/sdca_fdl.h | 2 +
include/sound/sdca_interrupts.h | 14 ++-
include/sound/sdca_jack.h | 3 +
include/sound/soc-component.h | 2 +
sound/soc/sdca/sdca_class.c | 4 +-
sound/soc/sdca/sdca_class_function.c | 6 +-
sound/soc/sdca/sdca_fdl.c | 13 +-
sound/soc/sdca/sdca_interrupts.c | 174 +++++++++++++++------------
sound/soc/sdca/sdca_jack.c | 88 ++++++++------
sound/soc/soc-component.c | 10 ++
sound/soc/soc-core.c | 5 +
11 files changed, 200 insertions(+), 121 deletions(-)
--
2.47.3
next reply other threads:[~2026-07-21 14:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-21 14:36 Charles Keepax [this message]
2026-07-21 14:36 ` [PATCH v4 1/7] ASoC: SDCA: Rename sdca_irq_allocate() to include devm Charles Keepax
2026-07-21 14:36 ` [PATCH v4 2/7] ASoC: SDCA: Add sdca_irq_cleanup_late() Charles Keepax
2026-07-21 14:36 ` [PATCH v4 3/7] ASoC: SDCA: Remove devm from primary IRQ cleanup Charles Keepax
2026-07-21 14:36 ` [PATCH v4 4/7] ASoC: SDCA: Populate IRQ data earlier Charles Keepax
2026-07-21 14:36 ` [PATCH v4 5/7] ASoC: Add a component fixup_controls callback Charles Keepax
2026-07-21 14:36 ` [PATCH v4 6/7] ASoC: SDCA: Switch to fixup_controls callback for IRQ registration Charles Keepax
2026-07-21 14:36 ` [PATCH v4 7/7] ASoC: SDCA: Move kcontrol search out of IRQ Charles Keepax
2026-07-27 17:47 ` [PATCH v4 0/7] Fix races on creation of SDCA jack detection Mark Brown
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=20260721143636.361814-1-ckeepax@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=shumingf@realtek.com \
--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