Messages in this thread Patch in this message | | | From | Juri Lelli <> | Subject | [RFC PATCH 07/19] cpufreq: assert locking when accessing cpufreq_governor_list | Date | Mon, 11 Jan 2016 17:35:48 +0000 |
| |
cpufreq_governor_list is guarded by cpufreq_governor_mutex. Add appropriate locking assertions to check that we always access the list while holding the lock protecting it.
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net> Cc: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Juri Lelli <juri.lelli@arm.com> --- drivers/cpufreq/cpufreq.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 98adbc2..7dae7f3 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -506,6 +506,7 @@ static struct cpufreq_governor *find_governor(const char *str_governor) { struct cpufreq_governor *t; + lockdep_assert_held(&cpufreq_governor_mutex); for_each_governor(t) if (!strncasecmp(str_governor, t->name, CPUFREQ_NAME_LEN)) return t; @@ -693,6 +694,7 @@ static ssize_t show_scaling_available_governors(struct cpufreq_policy *policy, goto out; } + lockdep_assert_held(&cpufreq_governor_mutex); for_each_governor(t) { if (i >= (ssize_t) ((PAGE_SIZE / sizeof(char)) - (CPUFREQ_NAME_LEN + 2))) @@ -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); } -- 2.2.2
| |