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>
This commit is contained in:
parent
4f750c9308
commit
56d07db274
2 changed files with 1 additions and 7 deletions
|
@ -1739,15 +1739,13 @@ static int __cpufreq_governor(struct cpufreq_policy *policy,
|
||||||
policy->cpu, event);
|
policy->cpu, event);
|
||||||
|
|
||||||
mutex_lock(&cpufreq_governor_lock);
|
mutex_lock(&cpufreq_governor_lock);
|
||||||
if (policy->governor_busy
|
if ((policy->governor_enabled && event == CPUFREQ_GOV_START)
|
||||||
|| (policy->governor_enabled && event == CPUFREQ_GOV_START)
|
|
||||||
|| (!policy->governor_enabled
|
|| (!policy->governor_enabled
|
||||||
&& (event == CPUFREQ_GOV_LIMITS || event == CPUFREQ_GOV_STOP))) {
|
&& (event == CPUFREQ_GOV_LIMITS || event == CPUFREQ_GOV_STOP))) {
|
||||||
mutex_unlock(&cpufreq_governor_lock);
|
mutex_unlock(&cpufreq_governor_lock);
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
policy->governor_busy = true;
|
|
||||||
if (event == CPUFREQ_GOV_STOP)
|
if (event == CPUFREQ_GOV_STOP)
|
||||||
policy->governor_enabled = false;
|
policy->governor_enabled = false;
|
||||||
else if (event == CPUFREQ_GOV_START)
|
else if (event == CPUFREQ_GOV_START)
|
||||||
|
@ -1776,9 +1774,6 @@ static int __cpufreq_governor(struct cpufreq_policy *policy,
|
||||||
((event == CPUFREQ_GOV_POLICY_EXIT) && !ret))
|
((event == CPUFREQ_GOV_POLICY_EXIT) && !ret))
|
||||||
module_put(policy->governor->owner);
|
module_put(policy->governor->owner);
|
||||||
|
|
||||||
mutex_lock(&cpufreq_governor_lock);
|
|
||||||
policy->governor_busy = false;
|
|
||||||
mutex_unlock(&cpufreq_governor_lock);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,6 @@ struct cpufreq_policy {
|
||||||
struct cpufreq_governor *governor; /* see below */
|
struct cpufreq_governor *governor; /* see below */
|
||||||
void *governor_data;
|
void *governor_data;
|
||||||
bool governor_enabled; /* governor start/stop flag */
|
bool governor_enabled; /* governor start/stop flag */
|
||||||
bool governor_busy;
|
|
||||||
|
|
||||||
struct work_struct update; /* if update_policy() needs to be
|
struct work_struct update; /* if update_policy() needs to be
|
||||||
* called, but you're in IRQ context */
|
* called, but you're in IRQ context */
|
||||||
|
|
Loading…
Reference in a new issue