* [PATCH] driver core: Add missing pm_runtime_put_noidle
@ 2022-01-17 11:27 Yongzhi Liu
0 siblings, 0 replies; 3+ messages in thread
From: Yongzhi Liu @ 2022-01-17 11:27 UTC (permalink / raw)
To: gregkh, rafael; +Cc: linux-kernel, lyz_cs
pm_runtime_get_noresume() in device_shutdown increments the
runtime PM usage counter, thus a matching decrement is needed
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 7bb957b..d41be8a 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -4533,6 +4533,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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] driver core: Add missing pm_runtime_put_noidle
2022-01-17 11:07 Yongzhi Liu
@ 2022-01-17 14:01 ` Rafael J. Wysocki
0 siblings, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2022-01-17 14:01 UTC (permalink / raw)
To: Yongzhi Liu
Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Linux Kernel Mailing List
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
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] driver core: Add missing pm_runtime_put_noidle
@ 2022-01-17 11:07 Yongzhi Liu
2022-01-17 14:01 ` Rafael J. Wysocki
0 siblings, 1 reply; 3+ messages in thread
From: Yongzhi Liu @ 2022-01-17 11:07 UTC (permalink / raw)
To: gregkh, rafael; +Cc: linux-kernel, lyz_cs
pm_runtime_get_noresume() in device_shutdown increments the
runtime PM usage counter, thus a matching decrement is needed
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-01-17 14:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-17 11:27 [PATCH] driver core: Add missing pm_runtime_put_noidle Yongzhi Liu
-- strict thread matches above, loose matches on Subject: below --
2022-01-17 11:07 Yongzhi Liu
2022-01-17 14:01 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).