lkml.org 
[lkml]   [2016]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 07/19] cpufreq: assert locking when accessing cpufreq_governor_list
Hi,

On 12/01/16 15:31, Viresh Kumar wrote:
> On 11-01-16, 17:35, Juri Lelli wrote:
> > @@ -2025,6 +2027,7 @@ int cpufreq_register_governor(struct cpufreq_governor *governor)
> > err = -EBUSY;
> > if (!find_governor(governor->name)) {
> > err = 0;
> > + lockdep_assert_held(&cpufreq_governor_mutex);
> > list_add(&governor->governor_list, &cpufreq_governor_list);
> > }
>
> Why here? This is how the routine looks like:
>

I guess I was simply over-paranoid. We can drop this assertion.

Thanks,

- Juri

> int cpufreq_register_governor(struct cpufreq_governor *governor)
> {
> int err;
>
> if (!governor)
> return -EINVAL;
>
> if (cpufreq_disabled())
> return -ENODEV;
>
> mutex_lock(&cpufreq_governor_mutex);
>
> governor->initialized = 0;
> err = -EBUSY;
> if (!find_governor(governor->name)) {
> err = 0;
> list_add(&governor->governor_list, &cpufreq_governor_list);
> }
>
> mutex_unlock(&cpufreq_governor_mutex);
> return err;
> }
>
>
> --
> viresh
>

\
 
 \ /
  Last update: 2016-01-12 17:21    [W:0.455 / U:0.912 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site