PM / runtime: Update links_count also if !CONFIG_SRCU

"Linux Kernel Mailing List" <[email protected]> Fri, 16 Feb 2018 17:08:31 +0000 (UTC)
Newsgroups gmane.linux.kernel.commits.head
Message-ID <[email protected]>
Web:        https://git.kernel.org/torvalds/c/433986c2c265d106d6a8e88006e0131fefc92b7b
Commit:     433986c2c265d106d6a8e88006e0131fefc92b7b
Parent:     69728051f5bf15efaf6edfbcfe1b5a49a2437918
Refname:    refs/heads/master
Author:     Lukas Wunner <[email protected]>
AuthorDate: Sat Feb 10 19:13:58 2018 +0100
Committer:  Rafael J. Wysocki <[email protected]>
CommitDate: Mon Feb 12 11:12:58 2018 +0100

    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: v4.10+ <[email protected]> # v4.10+
    Signed-off-by: Lukas Wunner <[email protected]>
    Signed-off-by: Rafael J. Wysocki <[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);
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html