From: Jon Hunter <jonathanh@nvidia.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
Kevin Hilman <khilman@kernel.org>,
Ulf Hansson <ulf.hansson@linaro.org>
Cc: Thierry Reding <thierry.reding@gmail.com>,
linux-pm@vger.kernel.org, linux-tegra@vger.kernel.org,
Jon Hunter <jonathanh@nvidia.com>
Subject: [PATCH 1/2] PM / Domains: Fix removal of a subdomain
Date: Fri, 4 Mar 2016 10:55:14 +0000 [thread overview]
Message-ID: <1457088915-17284-1-git-send-email-jonathanh@nvidia.com> (raw)
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
next reply other threads:[~2016-03-04 10:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-04 10:55 Jon Hunter [this message]
[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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1457088915-17284-1-git-send-email-jonathanh@nvidia.com \
--to=jonathanh@nvidia.com \
--cc=khilman@kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=thierry.reding@gmail.com \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox