Re: [PATCH] ASoC: arizona-jack: Fix runtime PM imbalance in arizona_start_hpdet_acc_id()
From: Charles Keepax
Date: Wed Sep 16 2026 - 06:07:30 EST
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@xxxxxxxxxxxxxxx
> Signed-off-by: Wentao Liang <vulab@xxxxxxxxxxx>
> ---
> 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@xxxxxxxxxxxxxxxxxxxxx>
Thanks,
Charles