2018-02-10 18:14:55

by Lukas Wunner

[permalink] [raw]
Subject: [PATCH] PM / runtime: Update links_count also if !CONFIG_SRCU

Commit baa8809f6097 ("PM / runtime: Optimize the use of device links")
added an invocation of pm_runtime_drop_link() to __device_link_del().
However there are two variants of that function, one for CONFIG_SRCU and
another for !CONFIG_SRCU, and the commit only modified the former.

Fixes: baa8809f6097 ("PM / runtime: Optimize the use of device links")
Cc: [email protected] # v4.10+
Cc: Rafael J. Wysocki <[email protected]>
Signed-off-by: Lukas Wunner <[email protected]>
---
drivers/base/core.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index b2261f92f2f1..5847364f25d9 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -310,6 +310,9 @@ static void __device_link_del(struct device_link *link)
dev_info(link->consumer, "Dropping the link to %s\n",
dev_name(link->supplier));

+ if (link->flags & DL_FLAG_PM_RUNTIME)
+ pm_runtime_drop_link(link->consumer);
+
list_del(&link->s_node);
list_del(&link->c_node);
device_link_free(link);
--
2.15.1



2018-02-14 10:56:31

by Rafael J. Wysocki

[permalink] [raw]
Subject: Re: [PATCH] PM / runtime: Update links_count also if !CONFIG_SRCU

On Saturday, February 10, 2018 7:13:58 PM CET Lukas Wunner wrote:
> Commit baa8809f6097 ("PM / runtime: Optimize the use of device links")
> added an invocation of pm_runtime_drop_link() to __device_link_del().
> However there are two variants of that function, one for CONFIG_SRCU and
> another for !CONFIG_SRCU, and the commit only modified the former.
>
> Fixes: baa8809f6097 ("PM / runtime: Optimize the use of device links")
> Cc: [email protected] # v4.10+
> Cc: Rafael J. Wysocki <[email protected]>
> Signed-off-by: Lukas Wunner <[email protected]>
> ---
> drivers/base/core.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index b2261f92f2f1..5847364f25d9 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -310,6 +310,9 @@ static void __device_link_del(struct device_link *link)
> dev_info(link->consumer, "Dropping the link to %s\n",
> dev_name(link->supplier));
>
> + if (link->flags & DL_FLAG_PM_RUNTIME)
> + pm_runtime_drop_link(link->consumer);
> +
> list_del(&link->s_node);
> list_del(&link->c_node);
> device_link_free(link);
>

Applied, thanks!