Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1306557

[RFC PATCH 10/19] cpufreq: assert policy->rwsem is held in cpufreq_set_policy

From Juri Lelli <juri.lelli@arm.com>
Newsgroups linux.kernel
Subject [RFC PATCH 10/19] cpufreq: assert policy->rwsem is held in cpufreq_set_policy
Date 2016-01-11 18:40 +0100
Message-ID <qPOBK-5zs-51@gated-at.bofh.it> (permalink)
References <qPOBH-5zs-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Since cpufreq_set_policy is modifying policy, it has to work under policy->
rwsem protection.

Assert such condition.

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 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index d91fdb8..f1f9fbc 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -2109,6 +2109,8 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy,
 	pr_debug("setting new policy for CPU %u: %u - %u kHz\n",
 		 new_policy->cpu, new_policy->min, new_policy->max);
 
+	lockdep_assert_held(&policy->rwsem);
+
 	memcpy(&new_policy->cpuinfo, &policy->cpuinfo, sizeof(policy->cpuinfo));
 
 	/*
-- 
2.2.2

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[RFC PATCH 10/19] cpufreq: assert policy->rwsem is held in cpufreq_set_policy Juri Lelli <juri.lelli@arm.com> - 2016-01-11 18:40 +0100

csiph-web