diff options
author | Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> | 2013-09-06 15:53:55 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-09-09 20:49:47 -0400 |
commit | 56d07db274b7b15ca38b60ea4a762d40de093000 (patch) | |
tree | e0168e68e3957a3122b1ed8069799b53078a0b05 /drivers/cpufreq | |
parent | 4f750c930822b92df74327a4d1364eff87701360 (diff) |
cpufreq: Remove temporary fix for race between CPU hotplug and sysfs-writes
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>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index cf016584b4ac..2863214c5381 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -1739,15 +1739,13 @@ static int __cpufreq_governor(struct cpufreq_policy *policy, | |||
1739 | policy->cpu, event); | 1739 | policy->cpu, event); |
1740 | 1740 | ||
1741 | mutex_lock(&cpufreq_governor_lock); | 1741 | mutex_lock(&cpufreq_governor_lock); |
1742 | if (policy->governor_busy | 1742 | if ((policy->governor_enabled && event == CPUFREQ_GOV_START) |
1743 | || (policy->governor_enabled && event == CPUFREQ_GOV_START) | ||
1744 | || (!policy->governor_enabled | 1743 | || (!policy->governor_enabled |
1745 | && (event == CPUFREQ_GOV_LIMITS || event == CPUFREQ_GOV_STOP))) { | 1744 | && (event == CPUFREQ_GOV_LIMITS || event == CPUFREQ_GOV_STOP))) { |
1746 | mutex_unlock(&cpufreq_governor_lock); | 1745 | mutex_unlock(&cpufreq_governor_lock); |
1747 | return -EBUSY; | 1746 | return -EBUSY; |
1748 | } | 1747 | } |
1749 | 1748 | ||
1750 | policy->governor_busy = true; | ||
1751 | if (event == CPUFREQ_GOV_STOP) | 1749 | if (event == CPUFREQ_GOV_STOP) |
1752 | policy->governor_enabled = false; | 1750 | policy->governor_enabled = false; |
1753 | else if (event == CPUFREQ_GOV_START) | 1751 | else if (event == CPUFREQ_GOV_START) |
@@ -1776,9 +1774,6 @@ static int __cpufreq_governor(struct cpufreq_policy *policy, | |||
1776 | ((event == CPUFREQ_GOV_POLICY_EXIT) && !ret)) | 1774 | ((event == CPUFREQ_GOV_POLICY_EXIT) && !ret)) |
1777 | module_put(policy->governor->owner); | 1775 | module_put(policy->governor->owner); |
1778 | 1776 | ||
1779 | mutex_lock(&cpufreq_governor_lock); | ||
1780 | policy->governor_busy = false; | ||
1781 | mutex_unlock(&cpufreq_governor_lock); | ||
1782 | return ret; | 1777 | return ret; |
1783 | } | 1778 | } |
1784 | 1779 | ||