Re: [PATCH v2] coccinelle: api: add a checker for pm_runtime_use_autosuspend() usage
From: Julia Lawall
Date: Wed Sep 16 2026 - 05:36:24 EST
On Wed, 16 Sep 2026, Johan Hovold wrote:
> On Tue, Sep 15, 2026 at 06:43:27AM +0000, Joshua Crofts wrote:
> > Add a checker for ensuring that pm_runtime_dont_use_autosuspend() is
> > called in a file if pm_runtime_use_autosuspend() is called and its
> > devm_* counterpart isn't present.
> >
> > Without _dont_use_autosuspend(), removing devices causes resource leaks.
>
> No, as I've explained repeatedly elsewhere, it does not cause any
> resource leaks. [1][2]
>
> The autosuspend setting leaks if you will, but that only matters in the
> theoretical corner case of someone rebinding a different driver (which
> will soon also taint the kernel).
>
> So don't exaggerate the impact, this is essentially just a cleanup,
> which is fine in itself.
Thanks for the feedback. Joshua, please update the patch accordingly.
julia
>
> > Assisted-by: LLM
> > Signed-off-by: Joshua Crofts <joshua.crofts1@xxxxxxxxx>
>
> Johan
>
> [1] https://lore.kernel.org/all/aqpd3viN1UoZBkgL@xxxxxxxxxxxxxxxxxxxx/
> [2] https://lore.kernel.org/linux-iio/aow51Nk-cet9qaUQ@xxxxxxxxxxxxxxxxxxxx/
>