cpufreq: governor: Avoid invalid states with additional checks
authorViresh Kumar <viresh.kumar@linaro.org>
Sat, 18 Jul 2015 06:01:01 +0000 (11:31 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 20 Jul 2015 23:12:02 +0000 (01:12 +0200)
commita72c49590a1f9e5d26a71c3f807dbb8958c93513
treec8f6bdb5ddc84ca595e68de19c516dcde2e11f36
parent43e0ee361e96229959c2ce1eda1ad9d6b3c191b2
cpufreq: governor: Avoid invalid states with additional checks

There can be races where the request has come to a wrong state. For
example INIT followed by STOP (instead of START) or START followed by
EXIT (instead of STOP).

Address these races by making sure the state-machine never gets into
any invalid state. Also return an error if an invalid state-transition
is requested.

Reviewed-and-tested-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cpufreq_governor.c