cpufreq: make sure frequency transitions are serialized
authorViresh Kumar <viresh.kumar@linaro.org>
Wed, 19 Jun 2013 04:46:55 +0000 (10:16 +0530)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:47:23 +0000 (11:47 +0900)
commit6a7e6f0f6546aa4990cdd1b1101daab20aec9b65
treecabb284de11667f5cf7efba13b2ab5af0b382e28
parent2247da9c0bb0427f1d81a71a8339edf5c1e434b2
cpufreq: make sure frequency transitions are serialized

Whenever we are changing frequency of a cpu, we are calling PRECHANGE and
POSTCHANGE notifiers. They must be serialized. i.e. PRECHANGE or POSTCHANGE
shouldn't be called twice contiguously.

This can happen due to bugs in users of __cpufreq_driver_target() or actual
cpufreq drivers who are sending these notifiers.

This patch adds some protection against this. Now, we keep track of the last
transaction and see if something went wrong.

Change-Id: I0f5465bd515c431ae2d3711d065f70aacec7e978
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cpufreq.c
include/linux/cpufreq.h