Re: [PATCH v2 2/2] regulator: fp9931: Fix Runtime PM usage count underflow in v3p3 ops
From: Andreas Kemnade
Date: Sat Jul 25 2026 - 15:51:11 EST
On Fri, 24 Jul 2026 18:34:41 +0800
robby.cai@xxxxxxxxxxx wrote:
> From: Robby Cai <robby.cai@xxxxxxx>
>
> The fp9931_v3p3_enable() callback acquires a Runtime PM reference
> which remains held until fp9931_v3p3_disable() releases it.
>
> Device-level Runtime PM lifetime is also managed through the shared
> VCOM enable path: fp9931_set_enable() acquires a reference and
> fp9931_clear_enable() releases it.
>
> As a result, the Runtime PM usage count may already have reached 0
> before fp9931_v3p3_disable() is invoked. In that case,
> fp9931_v3p3_disable() calls pm_runtime_put_autosuspend() on an
> already-zero count, triggering:
>
> fp9931 1-0018: Runtime PM usage count underflow!
>
> Holding a Runtime PM reference across the V3P3 regulator lifetime is
> unnecessary. V3P3 only needs the device to be runtime-active for the
> duration of the register access.
>
> Fix this by scoping the Runtime PM reference lifetime to the register
> access itself, pairing pm_runtime_resume_and_get() and
> pm_runtime_put_autosuspend() within each callback.
>
> Fixes: 12d821bd13d4 ("regulator: Add FP9931/JD9930 driver")
> Signed-off-by: Robby Cai <robby.cai@xxxxxxx>
> ---
> drivers/regulator/fp9931.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/regulator/fp9931.c b/drivers/regulator/fp9931.c
> index ff743a8b0dfe..0d926546221a 100644
> --- a/drivers/regulator/fp9931.c
> +++ b/drivers/regulator/fp9931.c
> @@ -214,8 +214,7 @@ static int fp9931_v3p3_enable(struct
> regulator_dev *rdev) return ret;
>
> ret = regulator_enable_regmap(rdev);
> - if (ret < 0)
> - pm_runtime_put_autosuspend(data->dev);
> + pm_runtime_put_autosuspend(data->dev);
>
if autosuspend kicks in, the whole chip will
be powered off, so if no vcom/vposneg is enabled, v3p3 will also be
disabled.
Regards,
Andreas