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>,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Jiale Yao <yaojiale02@163.com>
Subject: [PATCH 2/6] ASoC: rt711-sdw: always cancel jack work on remove
Date: Fri, 25 Sep 2026 22:50:14 +0800 [thread overview]
Message-ID: <20260925145019.2290367-3-yaojiale02@163.com> (raw)
In-Reply-To: <20260925145019.2290367-1-yaojiale02@163.com>
rt711_sdw_remove() cancels the jack and calibration work only when
hw_init is true. rt711_update_status() clears hw_init when the SoundWire
slave becomes unattached, but work may already have been queued by
rt711_interrupt_callback() or the jack initialization path.
A remove after that status update can therefore skip the cancellation and
leave 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: ac63716da307 ("ASoC: Realtek/Maxim SoundWire codecs: disable pm_runtime on remove")
Signed-off-by: Jiale Yao <yaojiale02@163.com>
---
sound/soc/codecs/rt711-sdw.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/rt711-sdw.c b/sound/soc/codecs/rt711-sdw.c
index 4ad2b1da1954..798d181d5c90 100644
--- a/sound/soc/codecs/rt711-sdw.c
+++ b/sound/soc/codecs/rt711-sdw.c
@@ -461,11 +461,9 @@ static void rt711_sdw_remove(struct sdw_slave *slave)
{
struct rt711_priv *rt711 = dev_get_drvdata(&slave->dev);
- if (rt711->hw_init) {
- cancel_delayed_work_sync(&rt711->jack_detect_work);
- cancel_delayed_work_sync(&rt711->jack_btn_check_work);
- cancel_work_sync(&rt711->calibration_work);
- }
+ cancel_delayed_work_sync(&rt711->jack_detect_work);
+ cancel_delayed_work_sync(&rt711->jack_btn_check_work);
+ cancel_work_sync(&rt711->calibration_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 ` Jiale Yao [this message]
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-3-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=pierre-louis.bossart@linux.dev \
--cc=rander.wang@intel.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®