From: Jiale Yao <yaojiale02@163.com>
To: Oder Chiou <oder_chiou@realtek.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>,
Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>,
Rander Wang <rander.wang@intel.com>,
Bard Liao <yung-chuan.liao@linux.intel.com>,
Shuming Fan <shumingf@realtek.com>, Jack Yu <jack.yu@realtek.com>,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Jiale Yao <yaojiale02@163.com>
Subject: [PATCH 0/6] ASoC: rt-sdw: always cancel jack work on remove
Date: Fri, 25 Sep 2026 22:50:12 +0800 [thread overview]
Message-ID: <20260925145019.2290367-1-yaojiale02@163.com> (raw)
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(-)
--
2.34.1
next reply other threads:[~2026-09-25 14:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-25 14:50 Jiale Yao [this message]
2026-09-25 14:50 ` [PATCH 1/6] ASoC: rt5682-sdw: " Jiale Yao
2026-09-25 14:50 ` [PATCH 2/6] ASoC: rt711-sdw: " Jiale Yao
2026-09-25 14:50 ` [PATCH 3/6] ASoC: rt711-sdca: " Jiale Yao
2026-09-25 14:50 ` [PATCH 4/6] ASoC: rt712-sdca: " Jiale Yao
2026-09-25 14:50 ` [PATCH 5/6] ASoC: rt721-sdca: " Jiale Yao
2026-09-25 14:50 ` [PATCH 6/6] ASoC: rt722-sdca: " Jiale Yao
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=20260925145019.2290367-1-yaojiale02@163.com \
--to=yaojiale02@163.com \
--cc=broonie@kernel.org \
--cc=jack.yu@realtek.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=oder_chiou@realtek.com \
--cc=perex@perex.cz \
--cc=pierre-louis.bossart@linux.dev \
--cc=rander.wang@intel.com \
--cc=shumingf@realtek.com \
--cc=tiwai@suse.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
all inboxes | Powered by JetHome®