diff options
author | Anson Huang <b20788@freescale.com> | 2012-08-19 01:12:59 +0800 |
---|---|---|
committer | Anson Huang <b20788@freescale.com> | 2012-08-22 00:49:54 +0800 |
commit | 74474dc32f0404004b51b8ec26648856b940cee5 (patch) | |
tree | a97c1bc09e22c41fc67a45bb8863d1a7b0d051ae /arch/arm/plat-mxc | |
parent | 759217f29c354198cd26df414e989f4f632c2c5b (diff) |
ENGR00220370 [MX6]Fix BUS freq suspend/resume fail in low bus mode
1. BUS freq's set low bus setpoint using delat work, which
didn't have mutex lock, so in some scenarios, set high bus
freq function can be called at the same time, we need to move
mutex lock into these two routine;
2. Using pm notify to make sure bus freq set to high setpoint
before supend and restore after resume.
3. Clear build warning.
Signed-off-by: Anson Huang <b20788@freescale.com>
Diffstat (limited to 'arch/arm/plat-mxc')
-rwxr-xr-x | arch/arm/plat-mxc/cpufreq.c | 6 | ||||
-rwxr-xr-x | arch/arm/plat-mxc/dvfs_core.c | 16 |
2 files changed, 13 insertions, 9 deletions
diff --git a/arch/arm/plat-mxc/cpufreq.c b/arch/arm/plat-mxc/cpufreq.c index 52112ef59939..ee041507038e 100755 --- a/arch/arm/plat-mxc/cpufreq.c +++ b/arch/arm/plat-mxc/cpufreq.c @@ -96,9 +96,11 @@ int set_cpu_freq(int freq) /*Set the voltage for the GP domain. */ if (freq > org_cpu_rate) { mutex_lock(&bus_freq_mutex); - if (low_bus_freq_mode || audio_bus_freq_mode) + if (low_bus_freq_mode || audio_bus_freq_mode) { + mutex_unlock(&bus_freq_mutex); set_high_bus_freq(0); - mutex_unlock(&bus_freq_mutex); + } else + mutex_unlock(&bus_freq_mutex); if (freq == cpu_op_tbl[0].cpu_rate && !IS_ERR(soc_regulator) && !IS_ERR(pu_regulator)) { ret = regulator_set_voltage(soc_regulator, soc_volt, soc_volt); diff --git a/arch/arm/plat-mxc/dvfs_core.c b/arch/arm/plat-mxc/dvfs_core.c index 9018b49511cc..a4a15482c71f 100755 --- a/arch/arm/plat-mxc/dvfs_core.c +++ b/arch/arm/plat-mxc/dvfs_core.c @@ -647,22 +647,22 @@ static void dvfs_core_work_handler(struct work_struct *work) mutex_lock(&bus_freq_mutex); if ((curr_op == cpu_op_nr - 1) && (!low_bus_freq_mode) && (low_freq_bus_ready) && !bus_incr) { - mutex_unlock(&bus_freq_mutex); if (!minf) set_cpu_freq(curr_op); /* If dvfs_core_op is greater than cpu_op_nr, it implies * we support LPAPM mode for this platform. */ if (dvfs_core_op > cpu_op_nr) { - mutex_lock(&bus_freq_mutex); set_low_bus_freq(); - mutex_unlock(&bus_freq_mutex); dvfs_load_config(cpu_op_nr + 1); } + mutex_unlock(&bus_freq_mutex); } else { - if (!high_bus_freq_mode) + if (!high_bus_freq_mode) { + mutex_unlock(&bus_freq_mutex); set_high_bus_freq(1); - mutex_unlock(&bus_freq_mutex); + } else + mutex_unlock(&bus_freq_mutex); if (!bus_incr) ret = set_cpu_freq(curr_op); bus_incr = 0; @@ -735,9 +735,11 @@ void stop_dvfs(void) curr_op = 0; mutex_lock(&bus_freq_mutex); - if (!high_bus_freq_mode) + if (!high_bus_freq_mode) { + mutex_unlock(&bus_freq_mutex); set_high_bus_freq(1); - mutex_unlock(&bus_freq_mutex); + } else + mutex_unlock(&bus_freq_mutex); curr_cpu = clk_get_rate(cpu_clk); if (curr_cpu != cpu_op_tbl[curr_op].cpu_rate) { |