diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2013-09-17 04:52:11 (GMT) |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-09-17 22:01:52 (GMT) |
commit | 8efd57657d8ef666810b55e609da72de92314dc4 (patch) | |
tree | 160796a62e6c96212665afcd028daa8cb7aa899a /arch | |
parent | 9c8f1ee40b6368e6b2775c9c9f816e2a5dca3c07 (diff) | |
download | linux-8efd57657d8ef666810b55e609da72de92314dc4.tar.xz |
cpufreq: unlock correct rwsem while updating policy->cpu
Current code looks like this:
WARN_ON(lock_policy_rwsem_write(cpu));
update_policy_cpu(policy, new_cpu);
unlock_policy_rwsem_write(cpu);
{lock|unlock}_policy_rwsem_write(cpu) takes/releases policy->cpu's rwsem.
Because cpu is changing with the call to update_policy_cpu(), the
unlock_policy_rwsem_write() will release the incorrect lock.
The right solution would be to release the same lock as was taken earlier. Also
update_policy_cpu() was also called from cpufreq_add_dev() without any locks and
so its better if we move this locking to inside update_policy_cpu().
This patch fixes a regression introduced in 3.12 by commit f9ba680d23
(cpufreq: Extract the handover of policy cpu to a helper function).
Reported-and-tested-by: Jon Medhurst<tixy@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'arch')
0 files changed, 0 insertions, 0 deletions