Re: [PATCH v4] ASoC: wm8962: Stop IRQ from requeuing mic_work on remove
From: Charles Keepax
Date: Mon Oct 19 2026 - 13:48:37 EST
On Sat, Oct 17, 2026 at 10:18:17PM -0400, Myeonghun Pak wrote:
> The WM8962 IRQ remains registered to the I2C device when an ASoC card is
> unbound. wm8962_remove() cancels mic_work, but a MICD or MICSCD interrupt
> can queue it again before the component is destroyed. The work then
> accesses the component and reports to the old jack.
>
> Mask microphone interrupts and disable detection in wm8962_mic_detect(),
> wait for any handler that already read the old mask, and drain mic_work
> before changing the jack pointer. When installing a new jack, unmask its
> interrupts before enabling detection, preserving the existing hardware
> sequence. Call this path from component remove while the component is
> still valid, leaving the IRQ registered for FLL, FIFO and thermal events.
>
> Tegra's card remove callback runs after ASoC removes the codec component
> and PCM runtimes. Drop its redundant microphone cleanup.
>
> Fixes: 0512615db6db ("ASoC: wm8962: Convert interrupt handler to direct regmap usage")
> Cc: stable@xxxxxxxxxxxxxxx
> Assisted-by: LLM
> Co-developed-by: Ijae Kim <ae878000@xxxxxxxxx>
> Signed-off-by: Ijae Kim <ae878000@xxxxxxxxx>
> Signed-off-by: Myeonghun Pak <mhun512@xxxxxxxxx>
> ---
Reviewed-by: Charles Keepax <ckeepax@xxxxxxxxxxxxxxxxxxxxx>
Thanks,
Charles