diff options
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-tegra/cpu-tegra.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-tegra/cpu-tegra.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-tegra/cpu-tegra3.c | 5 |
3 files changed, 7 insertions, 1 deletions
diff --git a/arch/arm/mach-tegra/cpu-tegra.c b/arch/arm/mach-tegra/cpu-tegra.c index d35c18e533d9..595f07d33538 100644 --- a/arch/arm/mach-tegra/cpu-tegra.c +++ b/arch/arm/mach-tegra/cpu-tegra.c @@ -469,7 +469,7 @@ unsigned int tegra_getspeed(unsigned int cpu) return rate; } -static int tegra_update_cpu_speed(unsigned long rate) +int tegra_update_cpu_speed(unsigned long rate) { int ret = 0; struct cpufreq_freqs freqs; diff --git a/arch/arm/mach-tegra/cpu-tegra.h b/arch/arm/mach-tegra/cpu-tegra.h index 2bba460514f3..0dda294ea2cc 100644 --- a/arch/arm/mach-tegra/cpu-tegra.h +++ b/arch/arm/mach-tegra/cpu-tegra.h @@ -22,6 +22,7 @@ #define __MACH_TEGRA_CPU_TEGRA_H unsigned int tegra_getspeed(unsigned int cpu); +int tegra_update_cpu_speed(unsigned long rate); int tegra_cpu_set_speed_cap(unsigned int *speed_cap); unsigned int tegra_count_slow_cpus(unsigned long speed_limit); unsigned int tegra_get_slowest_cpu_n(void); diff --git a/arch/arm/mach-tegra/cpu-tegra3.c b/arch/arm/mach-tegra/cpu-tegra3.c index f002803134a8..d17e79c22bdf 100644 --- a/arch/arm/mach-tegra/cpu-tegra3.c +++ b/arch/arm/mach-tegra/cpu-tegra3.c @@ -297,6 +297,11 @@ static int min_cpus_notify(struct notifier_block *nb, unsigned long n, void *p) mutex_lock(tegra3_cpu_lock); if ((n >= 2) && is_lp_cluster()) { + /* make sure cpu rate is within g-mode range before switching */ + unsigned int speed = max( + tegra_getspeed(0), clk_get_min_rate(cpu_g_clk) / 1000); + tegra_update_cpu_speed(speed); + if (!clk_set_parent(cpu_clk, cpu_g_clk)) { hp_stats_update(CONFIG_NR_CPUS, false); hp_stats_update(0, true); |