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>, Shuming Fan <shumingf@realtek.com>,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Jiale Yao <yaojiale02@163.com>
Subject: [PATCH 4/6] ASoC: rt712-sdca: always cancel jack work on remove
Date: Fri, 25 Sep 2026 22:50:16 +0800 [thread overview]
Message-ID: <20260925145019.2290367-5-yaojiale02@163.com> (raw)
In-Reply-To: <20260925145019.2290367-1-yaojiale02@163.com>
rt712_sdca_sdw_remove() cancels the jack work only when hw_init is true.
rt712_sdca_update_status() clears hw_init when the SoundWire slave
becomes unattached, but jack work may already have been queued by
rt712_sdca_interrupt_callback() or the jack initialization path.
A remove after that status update can therefore skip the cancellation and
leave delayed work pending after the codec private data has been freed.
The work objects are initialized during probe, so cancel them
unconditionally instead of relying on the mutable hw_init state.
Fixes: 6c39710da75c ("ASoC: rt712-sdca: Add RT712 SDCA driver for Jack and Amp topology")
Signed-off-by: Jiale Yao <yaojiale02@163.com>
---
sound/soc/codecs/rt712-sdca-sdw.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/sound/soc/codecs/rt712-sdca-sdw.c b/sound/soc/codecs/rt712-sdca-sdw.c
index edba0367d9ce..a9d4e0795175 100644
--- a/sound/soc/codecs/rt712-sdca-sdw.c
+++ b/sound/soc/codecs/rt712-sdca-sdw.c
@@ -386,10 +386,8 @@ static void rt712_sdca_sdw_remove(struct sdw_slave *slave)
{
struct rt712_sdca_priv *rt712 = dev_get_drvdata(&slave->dev);
- if (rt712->hw_init) {
- cancel_delayed_work_sync(&rt712->jack_detect_work);
- cancel_delayed_work_sync(&rt712->jack_btn_check_work);
- }
+ cancel_delayed_work_sync(&rt712->jack_detect_work);
+ cancel_delayed_work_sync(&rt712->jack_btn_check_work);
pm_runtime_disable(&slave->dev);
--
2.34.1
next prev parent 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 [PATCH 0/6] ASoC: rt-sdw: " Jiale Yao
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 ` Jiale Yao [this message]
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-5-yaojiale02@163.com \
--to=yaojiale02@163.com \
--cc=broonie@kernel.org \
--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=shumingf@realtek.com \
--cc=tiwai@suse.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®