cpufreq: Fix serialization of frequency transitions
authorViresh Kumar <viresh.kumar@linaro.org>
Tue, 2 Jul 2013 11:06:28 +0000 (16:36 +0530)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:47:23 +0000 (11:47 +0900)
commitca4546d2fec11439027f48bcc0fcd1f04e754d76
tree5fd2ea9a8d450950951e6fb32d071406b880311e
parent6a7e6f0f6546aa4990cdd1b1101daab20aec9b65
cpufreq: Fix serialization of frequency transitions

Commit 7c30ed ("cpufreq: make sure frequency transitions are serialized")
interacts poorly with systems that have a single core freqency for all
cores.  On such systems we have a single policy for all cores with
several CPUs.  When we do a frequency transition the governor calls the
pre and post change notifiers which causes cpufreq_notify_transition()
per CPU.  Since the policy is the same for all of them all CPUs after
the first and the warnings added are generated by checking a per-policy
flag the warnings will be triggered for all cores after the first.

Fix this by allowing notifier to be called for n times. Where n is the number of
cpus in policy->cpus.

Change-Id: I5712dde7f992644f9c3ddc8313151f80bea0d877
Reported-and-tested-by: Mark Brown <broonie@linaro.org>
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