From 5d425486f5e6780a5c2655558d319ffe97bac525 Mon Sep 17 00:00:00 2001 From: Tang Yuantian Date: Wed, 21 Jan 2015 14:37:52 +0800 Subject: cpufreq: qoriq: fixed a clock setting error Currently, CPU frequency switching is bypassed when T4240 workaround is not applied. It will cause DFS on non-t4240 not working. Signed-off-by: Tang Yuantian Change-Id: I61d528d490d50442c8361caaf2882fbf14eb0f1f Reviewed-on: http://git.am.freescale.net:8181/28853 Tested-by: Review Code-CDREVIEW Reviewed-by: Hongtao Jia Reviewed-by: Zhengxiong Jin diff --git a/drivers/cpufreq/qoriq-cpufreq.c b/drivers/cpufreq/qoriq-cpufreq.c index 16c1e7b..76a8e25 100644 --- a/drivers/cpufreq/qoriq-cpufreq.c +++ b/drivers/cpufreq/qoriq-cpufreq.c @@ -390,8 +390,8 @@ static int qoriq_cpufreq_target(struct cpufreq_policy *policy, struct clk *parent; int ret; struct cpu_data *data = per_cpu(cpu_data, policy->cpu); -#if (defined(CONFIG_PPC) && defined(CONFIG_HOTPLUG_CPU)) int workaround = 0; +#if (defined(CONFIG_PPC) && defined(CONFIG_HOTPLUG_CPU)) /* * workaround should be applied on 2 conditions: @@ -420,12 +420,18 @@ static int qoriq_cpufreq_target(struct cpufreq_policy *policy, parent = of_clk_get(data->parent, data->table[new].driver_data); #if (defined(CONFIG_PPC) && defined(CONFIG_HOTPLUG_CPU)) - if (t4240_workaround == 1) { + if (workaround == 1) { freqs.new = freqs.old; ret = -1; } #endif + if (workaround == 0) { + ret = clk_set_parent(data->clk, parent); + if (ret) + ret = -1; + } + cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); mutex_unlock(&cpufreq_lock); -- cgit v0.10.2