aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/cpufreq/cpufreq.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 52566f1f1050..f53fb41efb7b 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -923,7 +923,12 @@ static ssize_t store(struct kobject *kobj, struct attribute *attr,
923 struct freq_attr *fattr = to_attr(attr); 923 struct freq_attr *fattr = to_attr(attr);
924 ssize_t ret = -EINVAL; 924 ssize_t ret = -EINVAL;
925 925
926 cpus_read_lock(); 926 /*
927 * cpus_read_trylock() is used here to work around a circular lock
928 * dependency problem with respect to the cpufreq_register_driver().
929 */
930 if (!cpus_read_trylock())
931 return -EBUSY;
927 932
928 if (cpu_online(policy->cpu)) { 933 if (cpu_online(policy->cpu)) {
929 down_write(&policy->rwsem); 934 down_write(&policy->rwsem);