Re: [PATCH] PM: runtime: clarify pm_runtime_use_autosuspend() undo mechanism

From: Rafael J. Wysocki (Intel)

Date: Tue Oct 27 2026 - 12:04:04 EST


On Tue, Oct 27, 2026 at 1:21 PM Joshua Crofts <crofts@xxxxxxxxxx> wrote:
>
> Commit d1706f9da9f4 ("PM: runtime: call pm_runtime_dont_use_autosuspend() on reinit()")
> introduced a pm_runtime_dont_use_autosuspend() call that is executed automatically
> on driver exit without making any changes to the kerneldocs.
>
> Update the kerneldocs to clarify the current mechanism of
> pm_runtime_use_autosuspend() cleanup on exit.
>
> Signed-off-by: Joshua Crofts <crofts@xxxxxxxxxx>
> ---
> Hi, would it be possible for this patch to go in a fix PR before 7.4 is
> released to prevent any confusion about the mechanism of
> pm_runtime_use_autosuspend()? Thanks!
> ---
> Documentation/power/runtime_pm.rst | 10 +++++-----
> include/linux/pm_runtime.h | 6 +++---
> 2 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/Documentation/power/runtime_pm.rst b/Documentation/power/runtime_pm.rst
> index e4407b687f8b..40a5c23d5259 100644
> --- a/Documentation/power/runtime_pm.rst
> +++ b/Documentation/power/runtime_pm.rst
> @@ -425,11 +425,11 @@ but it also allows more flexibility in the handling of devices during the
> removal of their drivers.
>
> Drivers in ->remove() callback should undo the runtime PM changes done
> -in ->probe(). Usually this means calling pm_runtime_disable(),
> -pm_runtime_dont_use_autosuspend() etc. Alternatively, drivers can use
> -devm_pm_runtime_enable() during probe, which automatically takes care of
> -calling pm_runtime_disable() and pm_runtime_dont_use_autosuspend() upon driver
> -detachment.
> +in ->probe(). Usually this means calling pm_runtime_disable() etc.
> +Alternatively, drivers can use devm_pm_runtime_enable() during probe, which
> +automatically takes care of calling pm_runtime_disable() upon driver detachment.
> +Any pm_runtime_use_autosuspend() calls in a driver will be automatically undone
> +on driver exit.
>
> The user space can effectively disallow the driver of the device to power manage
> it at run time by changing the value of its /sys/devices/.../power/control
> diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
> index 322e3b17f987..ae68a9dc7fc5 100644
> --- a/include/linux/pm_runtime.h
> +++ b/include/linux/pm_runtime.h
> @@ -855,9 +855,9 @@ static inline void pm_runtime_disable(struct device *dev)
> * requested (or "autosuspend" will be handled as direct runtime-suspend for
> * it).
> *
> - * NOTE: It's important to undo this with pm_runtime_dont_use_autosuspend()
> - * at driver exit time unless your driver initially enabled pm_runtime
> - * with devm_pm_runtime_enable() (which handles it for you).
> + * NOTE: This is undone automatically with pm_runtime_dont_use_autosuspend() on
> + * driver exit regardless of whether a driver uses managed devm_* functions or
> + * not.
> */
> static inline void pm_runtime_use_autosuspend(struct device *dev)
> {
>
> base-commit: d135ab453a7400a34930bdda1ef4bdc8acfac80e
> --

Applied as 7.4-rc material, thanks!