Re: [PATCH] iio: proximity: srf04: fix runtime PM autosuspend cleanup
From: Joshua Crofts
Date: Fri Aug 07 2026 - 11:21:16 EST
On Fri, 7 Aug 2026 at 16:46, Guangshuo Li <lgs201920130244@xxxxxxxxx> wrote:
>
> srf04_probe() calls pm_runtime_use_autosuspend() when the optional
> power GPIO is present, but srf04_remove() does not call the matching
> pm_runtime_dont_use_autosuspend() before disabling runtime PM.
>
> The runtime PM documentation requires pm_runtime_use_autosuspend() to
> be balanced with pm_runtime_dont_use_autosuspend() when the driver is
> removed. Failing to do so can leave the autosuspend usage state
> unbalanced and may result in a usage_count leak when the autosuspend
> delay is negative.
>
> Add the missing pm_runtime_dont_use_autosuspend() call in the remove
> path before disabling runtime PM.
>
> This issue was found by manual code inspection.
>
> Fixes: 2251157b335b4 ("iio: srf04: add power management feature")
> Signed-off-by: Guangshuo Li <lgs201920130244@xxxxxxxxx>
> ---
Since this has a Fixes: tag it should also be marked for stable.
Reviewed-by: Joshua Crofts <joshua.crofts1@xxxxxxxxx>
Also, please check out Sashiko's review on this driver, several
interesting issues need fixing:
https://sashiko.dev/#/patchset/20260807141938.2491195-1-lgs201920130244%40gmail.com
Kind regards,
Joshua Crofts