Messages in this thread | | | Date | Fri, 27 Dec 2013 15:10:04 +0530 | Subject | Re: [PATCH] cpufreq: Fix timer/workqueue corruption by protecting reading governor_enabled | From | Viresh Kumar <> |
| |
On 27 December 2013 15:00, <jiel@marvell.com> wrote: > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c > -static DEFINE_MUTEX(cpufreq_governor_lock);
> diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h > index dc196bb..4faafe7 100644 > --- a/include/linux/cpufreq.h > +++ b/include/linux/cpufreq.h > @@ -254,6 +254,7 @@ struct cpufreq_driver { > > int cpufreq_register_driver(struct cpufreq_driver *driver_data); > int cpufreq_unregister_driver(struct cpufreq_driver *driver_data); > +static DEFINE_MUTEX(cpufreq_governor_lock);
No way, this would never work. This would create separate locks in each file that includes cpufreq.h. And so the locks you are talking about wouldn't protect governor.
Have you actually tested this code? If this fixes the breakage you saw? If this fixes it then you need to do better investigation of your problem..
you actually need to remove the static keyword from cpufreq.c file. Nothing else.
| |