Linux Power Management development
 help / color / mirror / Atom feed
* [PATCH 1/2] PM / Domains: Fix removal of a subdomain
@ 2016-03-04 10:55 Jon Hunter
       [not found] ` <1457088915-17284-1-git-send-email-jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Jon Hunter @ 2016-03-04 10:55 UTC (permalink / raw)
  To: Rafael J. Wysocki, Kevin Hilman, Ulf Hansson
  Cc: Thierry Reding, linux-pm, linux-tegra, Jon Hunter

Commit 30e7a65b3fdb ("PM / Domains: Ensure subdomain is not in use
before removing") added a test to ensure that a subdomain is not a
master to another subdomain or if any devices are using the subdomain
before removing. This change incorrectly used the "slave_links" list to
determine if the subdomain is a master to another subdomain, where it
should have been using the "master_links" list instead. The
"slave_links" list will never be empty for a subdomain and so a
subdomain can never be removed. Fix this by testing if the
"master_links" list is empty instead.

Fixes: 30e7a65b3fdb ("PM / Domains: Ensure subdomain is not in use before removing")

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Kevin Hilman <khilman@baylibre.com>
---

This first was originally included in the series to add PM domain support [0].
I am separating this for now, as it can be merged independently.

[0] http://marc.info/?l=linux-pm&m=145650174525180&w=2

 drivers/base/power/domain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index e8ca290dbf9d..ea9f2aa3fc33 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -1382,7 +1382,7 @@ int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
 	mutex_lock(&subdomain->lock);
 	mutex_lock_nested(&genpd->lock, SINGLE_DEPTH_NESTING);
 
-	if (!list_empty(&subdomain->slave_links) || subdomain->device_count) {
+	if (!list_empty(&subdomain->master_links) || subdomain->device_count) {
 		pr_warn("%s: unable to remove subdomain %s\n", genpd->name,
 			subdomain->name);
 		ret = -EBUSY;
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-03-10 23:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-04 10:55 [PATCH 1/2] PM / Domains: Fix removal of a subdomain Jon Hunter
     [not found] ` <1457088915-17284-1-git-send-email-jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-03-04 10:55   ` [PATCH 2/2] PM / Domains: Fix potential NULL pointer dereference Jon Hunter
     [not found]     ` <1457088915-17284-2-git-send-email-jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-03-04 11:07       ` Ulf Hansson
     [not found]         ` <CAPDyKFpha7TQbvZ2B9aDuoRuOFEHzD5ZwOCADvs6=0pwCNSgQg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-03-10 23:24           ` 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