lkml.org 
[lkml]   [2022]   [Jan]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] driver core: Add missing pm_runtime_put_noidle
On Mon, Jan 17, 2022 at 12:08 PM Yongzhi Liu <lyz_cs@pku.edu.cn> wrote:
>
> pm_runtime_get_noresume() in device_shutdown increments the
> runtime PM usage counter,

This is on purpose, to prevent devices from being runtime-suspended
after their shutdown callbacks have run.

> thus a matching decrement is needed

No, it is not, AFAICS.

> to keep the counter balanced.
>
> Signed-off-by: Yongzhi Liu <lyz_cs@pku.edu.cn>
> ---
> drivers/base/core.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index fd034d7..29950bd 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -4523,6 +4523,8 @@ void device_shutdown(void)
> dev->driver->shutdown(dev);
> }
>
> + pm_runtime_put_noidle(dev);
> +
> device_unlock(dev);
> if (parent)
> device_unlock(parent);
> --
> 2.7.4
>

\
 
 \ /
  Last update: 2022-01-17 15:03    [W:0.089 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site