Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Tristan Madani <tristmd@gmail.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, 2 Nov 2026 14:25:12 +0000	[thread overview]
Message-ID: <auidSMrWVmT8cW2u@opensource.cirrus.com> (raw)
In-Reply-To: <6ae87c48.eabad26b.28ae48.d5ab@mx.google.com>

On Mon, Nov 02, 2026 at 01:04:24PM +0100, Tristan Madani wrote:
> 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.

:-) I see, I think would be good to add a comment in the code for
that.

Thanks,
Charles

      reply	other threads:[~2026-11-02 14:26 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
2026-11-02 14:25       ` Charles Keepax [this message]

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=auidSMrWVmT8cW2u@opensource.cirrus.com \
    --to=ckeepax@opensource.cirrus.com \
    --cc=bardliao@realtek.com \
    --cc=broonie@kernel.org \
    --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 \
    --cc=tristmd@gmail.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