]> git.baikalelectronics.ru Git - kernel.git/commit
cpufreq: arm_big_little: fix frequency check when bL switcher is active
authorJon Medhurst \(Tixy\) <tixy@linaro.org>
Wed, 21 Oct 2015 09:55:33 +0000 (10:55 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 2 Nov 2015 00:58:27 +0000 (01:58 +0100)
commitb337cd690d895fd3e4cac0687af17583389c8322
tree0441ad96036b06ea942e890b5d08a86947ba7f4a
parent783c51c5c34c17b1b2cd2ddbd0f80e192064509b
cpufreq: arm_big_little: fix frequency check when bL switcher is active

The check for correct frequency being set in bL_cpufreq_set_rate is
broken when the big.LITTLE switcher is active, for two reasons.

 1. The 'new_rate' variable gets overwritten before the test by the
 code calculating the frequency of the old cluster.

 2. The frequency returned by bL_cpufreq_get_rate will be the virtual
 frequency, not the actual one the intended version of new_rate contains.

This means the function always returns an error causing an endless
stream of: "cpufreq: __target_index: Failed to change cpu frequency: -5"

As the intent is to check for errors that clk_set_rate doesn't report
lets move the check to immediately after that and directly use
clk_get_rate, rather than the arm_big_little helpers which only confuse
matters. Also, update the comment to be hopefully clearer about the
purpose of the code.

Fixes: 0bec0e703052 (cpufreq: arm_big_little: check if the frequency is set correctly)
Signed-off-by: Jon Medhurst <tixy@linaro.org>
Acked-by: Sudeep Holla <sudeep.holla@arm.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Michael Turquette <mturquette@baylibre.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/arm_big_little.c