Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH v5 0/4] ASoC: cancel pending delayed works on codec removal
@ 2026-10-30 17:48 Tristan Madani
  2026-10-30 17:48 ` [PATCH v5 1/4] ASoC: rt5668: cancel delayed works on component removal Tristan Madani
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Tristan Madani @ 2026-10-30 17:48 UTC (permalink / raw)
  To: Mark Brown, Oder Chiou, Liam Girdwood, Jaroslav Kysela,
	Takashi Iwai
  Cc: Bard Liao, Misael Lopez Cruz, patches, linux-sound, stable,
	Tristan Madani

Several ASoC codec drivers schedule delayed works for jack detection
and microphone polling but do not cancel them on component removal,
leaving handlers that can run against freed memory.

This series adds proper teardown ordering in four codec drivers:
rt5668, rt5659, twl6040, and wm8994.

Changes since v4:
  - Patch 1/4 (rt5668): correct Fixes tag from nonexistent
    e13da14e8543 to d59fb2856223 ("ASoC: rt5668: add rt5668B codec
    driver").  No code changes.
  - Patches 2-4/4: no changes.

Changes since v3:
  - rt5668 (1/4): track IRQ acquisition with irq_acquired flag to
    avoid calling disable_irq() when devm_request_threaded_irq()
    failed.  Re-enable IRQ in rt5668_probe() when a sound card
    rebinds after rt5668_remove() disabled it, preventing permanent
    IRQ silencing across unbind/rebind cycles.
  - Patches 2-4/4: no code changes.

Changes since v2:
  - rt5668 (1/4): also cancel jd_check_work (re-arms itself every
    500 jiffies while jack inserted). Disable IRQ before cancelling
    to prevent the handler from scheduling new work in the window
    between cancel and devm IRQ release.
  - rt5659 (2/4): no code change from v2.
  - twl6040 (3/4): swap ordering -- free_irq() first, then cancel
    residual work. Fixes the race where the handler fires between
    cancel and free_irq and re-arms the work.
  - wm8994 (4/4): no code change from v2.

Changes since v1:
  - Unified series per Mark Brown request.
  - rt5659: guard cancel with jack_detect_work_inited flag since
    INIT_DELAYED_WORK is conditional on jd_src, per Mark Brown.
  - wm8994: cancel mic_work before and after jackdet_bootstrap for
    cyclic re-arming through DAPM power-up chain.

Tristan Madani (4):
  ASoC: rt5668: cancel delayed works on component removal
  ASoC: rt5659: cancel jack_detect_work on component removal
  ASoC: twl6040: cancel headset jack work on component removal
  ASoC: wm8994: drain delayed works on remove and probe error

 sound/soc/codecs/rt5659.c  | 20 +++++++++++++++++++-
 sound/soc/codecs/rt5659.h  |  3 +++
 sound/soc/codecs/rt5668.c  | 20 +++++++++++++++++++-
 sound/soc/codecs/twl6040.c |  1 +
 sound/soc/codecs/wm8994.c  | 14 ++++++++++++++
 5 files changed, 56 insertions(+), 2 deletions(-)

-- 
2.47.3


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-10-30 18:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-30 17:48 [PATCH v5 0/4] ASoC: cancel pending delayed works on codec removal Tristan Madani
2026-10-30 17:48 ` [PATCH v5 1/4] ASoC: rt5668: cancel delayed works on component removal Tristan Madani
2026-10-30 18:04   ` sashiko-bot
2026-10-30 17:48 ` [PATCH v5 2/4] ASoC: rt5659: cancel jack_detect_work " Tristan Madani
2026-10-30 18:02   ` sashiko-bot
2026-10-30 17:48 ` [PATCH v5 3/4] ASoC: twl6040: cancel headset jack work " Tristan Madani
2026-10-30 17:48 ` [PATCH v5 4/4] ASoC: wm8994: drain delayed works on remove and probe error Tristan Madani

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox