@@ -128,7 +128,7 @@ static unsigned int bL_cpufreq_get_rate(unsigned int cpu)
static unsigned int
bL_cpufreq_set_rate(u32 cpu, u32 old_cluster, u32 new_cluster, u32 rate)
{
- u32 new_rate, prev_rate;
+ u32 new_rate, prev_rate, target_rate;
int ret;
bool bLs = is_bL_switching_enabled();
@@ -140,9 +140,11 @@ bL_cpufreq_set_rate(u32 cpu, u32 old_cluster, u32 new_cluster, u32 rate)
per_cpu(physical_cluster, cpu) = new_cluster;
new_rate = find_cluster_maxfreq(new_cluster);
+ target_rate = new_rate;
new_rate = ACTUAL_FREQ(new_cluster, new_rate);
} else {
new_rate = rate;
+ target_rate = new_rate;
}
pr_debug("%s: cpu: %d, old cluster: %d, new cluster: %d, freq: %d\n",
@@ -196,7 +198,7 @@ bL_cpufreq_set_rate(u32 cpu, u32 old_cluster, u32 new_cluster, u32 rate)
* be reading only the cached value anyway. This needs to be removed
* once clk core is fixed.
*/
- if (bL_cpufreq_get_rate(cpu) != new_rate)
+ if (bL_cpufreq_get_rate(cpu) != target_rate)
return -EIO;
return 0;
}