Skip to content

ASoC: rt-sdw: always cancel jack work on remove

Jiale Yao linux-sound lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6ASoC: rt5682-sdw: always cancel jack work on removesound/soc/codecs/rt5682-sdw.c+1 -20 replies
2/6ASoC: rt711-sdw: always cancel jack work on removesound/soc/codecs/rt711-sdw.c+3 -50 replies
3/6ASoC: rt711-sdca: always cancel jack work on removesound/soc/codecs/rt711-sdca-sdw.c+2 -40 replies
4/6ASoC: rt712-sdca: always cancel jack work on removesound/soc/codecs/rt712-sdca-sdw.c+2 -40 replies
5/6ASoC: rt721-sdca: always cancel jack work on removesound/soc/codecs/rt721-sdca-sdw.c+2 -40 replies
6/6ASoC: rt722-sdca: always cancel jack work on removesound/soc/codecs/rt722-sdca-sdw.c+2 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/6] ASoC: rt-sdw: always cancel jack work on remove

The Realtek SoundWire codec remove callbacks cancel jack work only while hw_init is true. hw_init is cleared by update_status() when the slave becomes unattached, but jack work can already have been queued by the interrupt callback or jack initialization path. If remove runs after that state transition, the pending work is not drained and can run after the codec private data has been freed.

The same lifecycle problem can be triggered in each codec:
1. init queues jack work;
2. update_status(UNATTACHED) clears hw_init;
3. remove sees hw_init false and skips the cancel;
4. the work runs after private data teardown.

Each codec initializes its work objects during probe, so the remove paths can cancel them unconditionally and pair the work lifetime with the codec private data lifetime instead of the mutable hw_init state.

The series fixes rt5682-sdw, rt711-sdw, rt711-sdca-sdw, rt712-sdca-sdw, rt721-sdca-sdw and rt722-sdca-sdw. Each patch is independent and applies to the same baseline.

Jiale Yao (6):
ASoC: rt5682-sdw: always cancel jack work on remove
ASoC: rt711-sdw: always cancel jack work on remove
ASoC: rt711-sdca: always cancel jack work on remove
ASoC: rt712-sdca: always cancel jack work on remove
ASoC: rt721-sdca: always cancel jack work on remove
ASoC: rt722-sdca: always cancel jack work on remove

 sound/soc/codecs/rt5682-sdw.c     | 3 +--
 sound/soc/codecs/rt711-sdca-sdw.c | 6 ++----
 sound/soc/codecs/rt711-sdw.c      | 8 +++-----
 sound/soc/codecs/rt712-sdca-sdw.c | 6 ++----
 sound/soc/codecs/rt721-sdca-sdw.c | 6 ++----
 sound/soc/codecs/rt722-sdca-sdw.c | 6 ++----
 6 files changed, 12 insertions(+), 23 deletions(-)
Signature · 1 line
2.34.1