Message ID | 1388731451-10963-1-git-send-email-jiel@marvell.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers | show |
On 3 January 2014 12:14, <jiel@marvell.com> wrote: > diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h > index dc196bb..15c62df 100644 > --- a/include/linux/cpufreq.h > +++ b/include/linux/cpufreq.h > @@ -389,6 +389,7 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy, > unsigned int relation); > int cpufreq_register_governor(struct cpufreq_governor *governor); > void cpufreq_unregister_governor(struct cpufreq_governor *governor); > +extern struct mutex cpufreq_governor_lock; > > /* CPUFREQ DEFAULT GOVERNOR */ > /* Move this to cpufreq_governor.h instead. I don't want this to be available for everybody to use it. -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 01/03/2014 02:50 PM, Viresh Kumar wrote: > On 3 January 2014 12:14, <jiel@marvell.com> wrote: >> diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h >> index dc196bb..15c62df 100644 >> --- a/include/linux/cpufreq.h >> +++ b/include/linux/cpufreq.h >> @@ -389,6 +389,7 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy, >> unsigned int relation); >> int cpufreq_register_governor(struct cpufreq_governor *governor); >> void cpufreq_unregister_governor(struct cpufreq_governor *governor); >> +extern struct mutex cpufreq_governor_lock; >> >> /* CPUFREQ DEFAULT GOVERNOR */ >> /* > Move this to cpufreq_governor.h instead. I don't want this to be available > for everybody to use it. OK. Have pushed PATCH v4. Please review again. Thanks! -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 16d7b4a..185c9f5 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -39,7 +39,7 @@ static struct cpufreq_driver *cpufreq_driver; static DEFINE_PER_CPU(struct cpufreq_policy *, cpufreq_cpu_data); static DEFINE_PER_CPU(struct cpufreq_policy *, cpufreq_cpu_data_fallback); static DEFINE_RWLOCK(cpufreq_driver_lock); -static DEFINE_MUTEX(cpufreq_governor_lock); +DEFINE_MUTEX(cpufreq_governor_lock); static LIST_HEAD(cpufreq_policy_list); #ifdef CONFIG_HOTPLUG_CPU diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c index e6be635..ba43991 100644 --- a/drivers/cpufreq/cpufreq_governor.c +++ b/drivers/cpufreq/cpufreq_governor.c @@ -119,8 +119,9 @@ void gov_queue_work(struct dbs_data *dbs_data, struct cpufreq_policy *policy, { int i; + mutex_lock(&cpufreq_governor_lock); if (!policy->governor_enabled) - return; + goto out_unlock; if (!all_cpus) { /* @@ -135,6 +136,9 @@ void gov_queue_work(struct dbs_data *dbs_data, struct cpufreq_policy *policy, for_each_cpu(i, policy->cpus) __gov_queue_work(i, dbs_data, delay); } + +out_unlock: + mutex_unlock(&cpufreq_governor_lock); } EXPORT_SYMBOL_GPL(gov_queue_work); diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index dc196bb..15c62df 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -389,6 +389,7 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy, unsigned int relation); int cpufreq_register_governor(struct cpufreq_governor *governor); void cpufreq_unregister_governor(struct cpufreq_governor *governor); +extern struct mutex cpufreq_governor_lock; /* CPUFREQ DEFAULT GOVERNOR */ /*