* [PATCH] ASoC: arizona-jack: Fix runtime PM imbalance in arizona_start_hpdet_acc_id()
@ 2026-09-16 7:29 Wentao Liang
2026-09-16 9:59 ` Charles Keepax
2026-09-16 21:08 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Wentao Liang @ 2026-09-16 7:29 UTC (permalink / raw)
To: broonie
Cc: lgirdwood, linux-kernel, linux-sound, patches, perex, tiwai,
Wentao Liang, stable
In arizona_start_hpdet_acc_id(), pm_runtime_get_sync() is called to keep
the device powered during headphone detection. If setting the HPDET mode
or starting the measurement fails and the function jumps to err,
pm_runtime_put_autosuspend() was not called while info->hpdet_active was
set to false, resulting in a runtime PM usage count leak.
Add pm_runtime_put_autosuspend() in the err error path to keep runtime PM
balanced.
Fixes: 9dd5e53d9d2f ("extcon: arizona: Retry HPDET identification for high impedance")
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..c84e4961655f 100644
--- a/sound/soc/codecs/arizona-jack.c
+++ b/sound/soc/codecs/arizona-jack.c
@@ -698,6 +698,7 @@ static void arizona_start_hpdet_acc_id(struct arizona_priv *info)
snd_soc_jack_report(info->jack, SND_JACK_HEADPHONE,
SND_JACK_LINEOUT | SND_JACK_HEADPHONE);
+ pm_runtime_put_autosuspend(arizona->dev);
info->hpdet_active = false;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: arizona-jack: Fix runtime PM imbalance in arizona_start_hpdet_acc_id()
2026-09-16 7:29 [PATCH] ASoC: arizona-jack: Fix runtime PM imbalance in arizona_start_hpdet_acc_id() Wentao Liang
@ 2026-09-16 9:59 ` Charles Keepax
2026-09-16 21:08 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Charles Keepax @ 2026-09-16 9:59 UTC (permalink / raw)
To: Wentao Liang
Cc: broonie, lgirdwood, linux-kernel, linux-sound, patches, perex,
tiwai, stable
On Wed, Sep 16, 2026 at 07:29:00AM +0000, Wentao Liang wrote:
> In arizona_start_hpdet_acc_id(), pm_runtime_get_sync() is called to keep
> the device powered during headphone detection. If setting the HPDET mode
> or starting the measurement fails and the function jumps to err,
> pm_runtime_put_autosuspend() was not called while info->hpdet_active was
> set to false, resulting in a runtime PM usage count leak.
>
> Add pm_runtime_put_autosuspend() in the err error path to keep runtime PM
> balanced.
>
> Fixes: 9dd5e53d9d2f ("extcon: arizona: Retry HPDET identification for high impedance")
> 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..c84e4961655f 100644
> --- a/sound/soc/codecs/arizona-jack.c
> +++ b/sound/soc/codecs/arizona-jack.c
> @@ -698,6 +698,7 @@ static void arizona_start_hpdet_acc_id(struct arizona_priv *info)
> snd_soc_jack_report(info->jack, SND_JACK_HEADPHONE,
> SND_JACK_LINEOUT | SND_JACK_HEADPHONE);
>
> + pm_runtime_put_autosuspend(arizona->dev);
> info->hpdet_active = false;
> }
Code is quite complex here but I think this looks good to me:
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Thanks,
Charles
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: arizona-jack: Fix runtime PM imbalance in arizona_start_hpdet_acc_id()
2026-09-16 7:29 [PATCH] ASoC: arizona-jack: Fix runtime PM imbalance in arizona_start_hpdet_acc_id() Wentao Liang
2026-09-16 9:59 ` Charles Keepax
@ 2026-09-16 21:08 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2026-09-16 21:08 UTC (permalink / raw)
To: Wentao Liang
Cc: lgirdwood, linux-kernel, linux-sound, patches, perex, tiwai,
stable
On Wed, 16 Sep 2026 07:29:00 +0000, Wentao Liang wrote:
> ASoC: arizona-jack: Fix runtime PM imbalance in arizona_start_hpdet_acc_id()
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.4
Thanks!
[1/1] ASoC: arizona-jack: Fix runtime PM imbalance in arizona_start_hpdet_acc_id()
https://git.kernel.org/broonie/sound/c/e04dcb895b46
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-09-17 11:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-16 7:29 [PATCH] ASoC: arizona-jack: Fix runtime PM imbalance in arizona_start_hpdet_acc_id() Wentao Liang
2026-09-16 9:59 ` Charles Keepax
2026-09-16 21:08 ` Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.