Re: [RFC PATCH 08/19] cpufreq: fix warning for cpufreq_init_policy unlocked access to cpufreq_governor_list

From: Viresh Kumar
Date: Wed Jan 13 2016 - 01:08:05 EST


On 12-01-16, 15:52, Juri Lelli wrote:
> Other users (i.e., cpufreq_parse_governor and cpufreq_register_governor)
> needs to take the mutex externally. So, we need to unify this behaviour.

No they don't have to.

And that's why I have been saying that we better nail down the exact
thing the mutex is supposed to protect.

There can be two cases here:
- It protects the governor list, in that case we can move it to
find_governor().
- It guarantees that the governor pointer stays valid: That's not true
as we are using the governor pointer outside of the lock.

And so I said, "No they don't have to" :)

--
viresh