* [PATCH] ASoC: arizona-jack: Fix runtime PM leak in arizona_start_mic()
@ 2026-09-17 16:46 Wentao Liang
2026-09-18 15:05 ` Charles Keepax
0 siblings, 1 reply; 2+ messages in thread
From: Wentao Liang @ 2026-09-17 16:46 UTC (permalink / raw)
To: broonie
Cc: ckeepax, cw00.choi, lgirdwood, linux-kernel, linux-sound,
patches, perex, tiwai, Wentao Liang, stable
arizona_start_mic() takes a runtime PM reference before enabling mic
detection, but the error path taken when regmap_update_bits_check()
fails returns without releasing it, since pm_runtime_put_autosuspend()
is only called in the !change branch. This leaks a runtime PM reference
whenever the register write fails.
Release the reference on the error path as well.
Fixes: fbdc60b2a787 ("extcon: arizona: Correct error handling on regmap_update_bits_check")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
sound/soc/codecs/arizona-jack.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/soc/codecs/arizona-jack.c b/sound/soc/codecs/arizona-jack.c
index a9063bac2752..09a100846fdb 100644
--- a/sound/soc/codecs/arizona-jack.c
+++ b/sound/soc/codecs/arizona-jack.c
@@ -274,6 +274,7 @@ static void arizona_start_mic(struct arizona_priv *info)
&change);
if (ret < 0) {
dev_err(arizona->dev, "Failed to enable micd: %d\n", ret);
+ pm_runtime_put_autosuspend(arizona->dev);
} else if (!change) {
regulator_disable(info->micvdd);
pm_runtime_put_autosuspend(arizona->dev);
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ASoC: arizona-jack: Fix runtime PM leak in arizona_start_mic()
2026-09-17 16:46 [PATCH] ASoC: arizona-jack: Fix runtime PM leak in arizona_start_mic() Wentao Liang
@ 2026-09-18 15:05 ` Charles Keepax
0 siblings, 0 replies; 2+ messages in thread
From: Charles Keepax @ 2026-09-18 15:05 UTC (permalink / raw)
To: Wentao Liang
Cc: broonie, cw00.choi, lgirdwood, linux-kernel, linux-sound,
patches, perex, tiwai, stable
On Thu, Sep 17, 2026 at 04:46:25PM +0000, Wentao Liang wrote:
> arizona_start_mic() takes a runtime PM reference before enabling mic
> detection, but the error path taken when regmap_update_bits_check()
> fails returns without releasing it, since pm_runtime_put_autosuspend()
> is only called in the !change branch. This leaks a runtime PM reference
> whenever the register write fails.
>
> Release the reference on the error path as well.
>
> Fixes: fbdc60b2a787 ("extcon: arizona: Correct error handling on regmap_update_bits_check")
> Cc: stable@vger.kernel.org
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> ---
> sound/soc/codecs/arizona-jack.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/sound/soc/codecs/arizona-jack.c b/sound/soc/codecs/arizona-jack.c
> index a9063bac2752..09a100846fdb 100644
> --- a/sound/soc/codecs/arizona-jack.c
> +++ b/sound/soc/codecs/arizona-jack.c
> @@ -274,6 +274,7 @@ static void arizona_start_mic(struct arizona_priv *info)
> &change);
> if (ret < 0) {
> dev_err(arizona->dev, "Failed to enable micd: %d\n", ret);
> + pm_runtime_put_autosuspend(arizona->dev);
Not sure this one makes sense. The current approach appears to be
leave the mic stuff going and just log the error. If we wanted to
drop the runtime reference here there would be more teardown to
add, such as disabling the regulator. However, the micdet ena
failing likely means the buttons don't work on the headset, but
the mic record is probably still be working.
In general be a little careful with fixing these quite complex
processes this and the one from the other day on the
hpdet_acc_id() are scary things to be tweaking especially if
these issues are being spotted by some sort of AI/automated
tooling, and not tested on actual hardware.
Thanks,
Charles
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-18 15:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-17 16:46 [PATCH] ASoC: arizona-jack: Fix runtime PM leak in arizona_start_mic() Wentao Liang
2026-09-18 15:05 ` Charles Keepax
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®