From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
To: rjw@sisk.pl, sboyd@codeaurora.org, viresh.kumar@linaro.org
Cc: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>,
cpufreq@vger.kernel.org, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 4/5] cpufreq: Remove temporary fix for race between CPU hotplug and sysfs-writes
Date: Sat, 07 Sep 2013 01:23:55 +0530 [thread overview]
Message-ID: <20130906195353.26919.76123.stgit@srivatsabhat.in.ibm.com> (raw)
In-Reply-To: <20130906195206.26919.20884.stgit@srivatsabhat.in.ibm.com>
Commit "cpufreq: serialize calls to __cpufreq_governor()" had been a temporary
and partial solution to the race condition between writing to a cpufreq sysfs
file and taking a CPU offline. Now that we have a proper and complete solution
to that problem, remove the temporary fix.
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
---
drivers/cpufreq/cpufreq.c | 7 +------
include/linux/cpufreq.h | 1 -
2 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index c2eb413..9909789 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1783,15 +1783,13 @@ static int __cpufreq_governor(struct cpufreq_policy *policy,
policy->cpu, event);
mutex_lock(&cpufreq_governor_lock);
- if (policy->governor_busy
- || (policy->governor_enabled && event == CPUFREQ_GOV_START)
+ if ((policy->governor_enabled && event == CPUFREQ_GOV_START)
|| (!policy->governor_enabled
&& (event == CPUFREQ_GOV_LIMITS || event == CPUFREQ_GOV_STOP))) {
mutex_unlock(&cpufreq_governor_lock);
return -EBUSY;
}
- policy->governor_busy = true;
if (event == CPUFREQ_GOV_STOP)
policy->governor_enabled = false;
else if (event == CPUFREQ_GOV_START)
@@ -1820,9 +1818,6 @@ static int __cpufreq_governor(struct cpufreq_policy *policy,
((event == CPUFREQ_GOV_POLICY_EXIT) && !ret))
module_put(policy->governor->owner);
- mutex_lock(&cpufreq_governor_lock);
- policy->governor_busy = false;
- mutex_unlock(&cpufreq_governor_lock);
return ret;
}
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index cca885d..d568f39 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -76,7 +76,6 @@ struct cpufreq_policy {
struct cpufreq_governor *governor; /* see below */
void *governor_data;
bool governor_enabled; /* governor start/stop flag */
- bool governor_busy;
struct work_struct update; /* if update_policy() needs to be
* called, but you're in IRQ context */
next prev parent reply other threads:[~2013-09-06 19:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-06 19:52 [PATCH 0/5] Cpufreq fixes related to cpu hotplug/sysfs-writes Srivatsa S. Bhat
2013-09-06 19:53 ` [PATCH 1/5] cpufreq: Split __cpufreq_remove_dev() into 2 parts (kobj cleanup & the rest) Srivatsa S. Bhat
2013-09-06 19:53 ` [PATCH 2/5] cpufreq: Invoke __cpufreq_remove_dev_finish() after releasing cpu_hotplug.lock Srivatsa S. Bhat
2013-09-06 19:53 ` [PATCH 3/5] cpufreq: Synchronize the cpufreq store_*() routines with CPU hotplug Srivatsa S. Bhat
2013-09-06 19:53 ` Srivatsa S. Bhat [this message]
2013-09-10 7:09 ` [PATCH 4/5] cpufreq: Remove temporary fix for race between CPU hotplug and sysfs-writes Viresh Kumar
2013-09-10 8:57 ` Srivatsa S. Bhat
2013-09-06 19:54 ` [PATCH 5/5] cpufreq: Use signed type for 'ret' variable, to store negative error values Srivatsa S. Bhat
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=20130906195353.26919.76123.stgit@srivatsabhat.in.ibm.com \
--to=srivatsa.bhat@linux.vnet.ibm.com \
--cc=cpufreq@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@sisk.pl \
--cc=sboyd@codeaurora.org \
--cc=viresh.kumar@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;
as well as URLs for NNTP newsgroup(s).