lkml.org 
[lkml]   [2013]   [Dec]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] cpufreq: Fix timer/workqueue corruption by protecting reading governor_enabled
From
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.


\
 
 \ /
  Last update: 2013-12-27 11:21    [W:0.051 / U:0.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site