]> git.baikalelectronics.ru Git - kernel.git/commit
cpufreq: create per policy rwsem instead of per CPU cpu_policy_rwsem
authorviresh kumar <viresh.kumar@linaro.org>
Fri, 18 Oct 2013 13:40:15 +0000 (19:10 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 25 Oct 2013 21:54:12 +0000 (23:54 +0200)
commiteaca5b0528a224c408e01e8fe4e3a17ae082430e
tree9d66845a9e2f1fbb6c2641d30f89f164724a5f76
parentb67afbe8c78c3a619446d2507fe1da20cda19ec3
cpufreq: create per policy rwsem instead of per CPU cpu_policy_rwsem

We have per-CPU cpu_policy_rwsem for cpufreq core, but we never use
all of them. We always use rwsem of policy->cpu and so we can
actually make this rwsem per policy instead.

This patch does this change. With this change other tricky situations
are also avoided now, like which lock to take while we are changing
policy->cpu, etc.

Suggested-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Tested-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cpufreq.c
include/linux/cpufreq.h