Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Tristan Madani <tristmd@gmail.com>
To: Charles Keepax <ckeepax@opensource.cirrus.com>
Cc: Mark Brown <broonie@kernel.org>,Oder Chiou
	<oder_chiou@realtek.com>,Liam Girdwood
	<lgirdwood@gmail.com>,Jaroslav Kysela <perex@perex.cz>,Takashi
	Iwai <tiwai@suse.com>,Bard Liao <bardliao@realtek.com>,Misael
	Lopez Cruz
	<misael.lopez@ti.com>,patches@opensource.cirrus.com,linux-sound@vger.kernel.org,stable@vger.kernel.org
Subject: Re: [PATCH v4 4/4] ASoC: wm8994: drain delayed works on remove and probe error
Date: Mon, 02 Nov 2026 13:04:24 +0100	[thread overview]
Message-ID: <6ae87c48.eabad26b.28ae48.d5ab@mx.google.com> (raw)
In-Reply-To: <auhdJGbYnY95tJBS@opensource.cirrus.com>

On Mon, 2 Nov 2026 at 09:51:32 +0000, Charles Keepax wrote:
> Both paths appears to cancel the mic_work twice?

Yes, intentional.  wm1811_mic_work() can re-arm jackdet_bootstrap
through the DAPM power-up chain (force-enabling MICBIAS2 triggers
clk_sys_event which queues jackdet_bootstrap), and
wm1811_jackdet_bootstrap() ultimately queues mic_work back.

So the sequence is:

  1. cancel mic_work           -- drain whatever is pending
  2. cancel jackdet_bootstrap  -- drain; if its handler was in flight
                                  during (1) it may have re-queued
                                  mic_work
  3. cancel mic_work           -- catch that re-arm

Without the second mic_work cancel, a jackdet_bootstrap handler
running concurrently with step 1 can slip a mic_work re-queue in
between steps 1 and 2, and that work fires after resources are freed.

Thanks,
Tristan

  reply	other threads:[~2026-11-02 12:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-30 17:04 [PATCH v4 0/4] ASoC: cancel pending delayed works on codec removal Tristan Madani
2026-10-30 17:04 ` [PATCH v4 1/4] ASoC: rt5668: cancel delayed works on component removal Tristan Madani
2026-10-30 17:04 ` [PATCH v4 2/4] ASoC: rt5659: cancel jack_detect_work " Tristan Madani
2026-10-30 17:04 ` [PATCH v4 3/4] ASoC: twl6040: cancel headset jack work " Tristan Madani
2026-10-30 17:04 ` [PATCH v4 4/4] ASoC: wm8994: drain delayed works on remove and probe error Tristan Madani
2026-11-02  9:51   ` Charles Keepax
2026-11-02 12:04     ` Tristan Madani [this message]
2026-11-02 14:25       ` Charles Keepax

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=6ae87c48.eabad26b.28ae48.d5ab@mx.google.com \
    --to=tristmd@gmail.com \
    --cc=bardliao@realtek.com \
    --cc=broonie@kernel.org \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-sound@vger.kernel.org \
    --cc=misael.lopez@ti.com \
    --cc=oder_chiou@realtek.com \
    --cc=patches@opensource.cirrus.com \
    --cc=perex@perex.cz \
    --cc=stable@vger.kernel.org \
    --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