diff options
author | Alex Frid <afrid@nvidia.com> | 2011-04-21 21:33:12 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:42:33 -0800 |
commit | 6a1aa24e805fabf26efa11b2af0f0183ab1aeda4 (patch) | |
tree | 177be9ba2b92abc34eefe6463c4a5342631c5cfe /arch/arm/mach-tegra/cpu-tegra.c | |
parent | 844407d8602dd20e940f2e5a0e6437b1f6a796f9 (diff) |
ARM: tegra: power: Check Tegra3 auto-hotplug speed balance
When current CPU complex frequency is above target range:
- bring new core on-line only if cpufreq governor requests for
all already on-lined CPUs are above 50% of current CPU frequency
- off-line one core (despite high pick request) if cpufreq
governor requests for at least 2 on-lined CPUs are below 25% of
current CPU frequency
- do nothing if neither of the above conditions is true
Original-Change-Id: I77e1bd543a8fadd51974f7d574f256a6e7e2979a
Reviewed-on: http://git-master/r/29702
Reviewed-by: Aleksandr Frid <afrid@nvidia.com>
Tested-by: Aleksandr Frid <afrid@nvidia.com>
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
Tested-by: Diwakar Tundlam <dtundlam@nvidia.com>
Reviewed-by: Scott Williams <scwilliams@nvidia.com>
Rebase-Id: Rc5c717454d1e09ca97ccc79fff60cb33fcf854e9
Diffstat (limited to 'arch/arm/mach-tegra/cpu-tegra.c')
-rw-r--r-- | arch/arm/mach-tegra/cpu-tegra.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/cpu-tegra.c b/arch/arm/mach-tegra/cpu-tegra.c index baf543674c3d..1d61146b50cc 100644 --- a/arch/arm/mach-tegra/cpu-tegra.c +++ b/arch/arm/mach-tegra/cpu-tegra.c @@ -362,6 +362,17 @@ static int tegra_update_cpu_speed(unsigned long rate) return 0; } +unsigned int tegra_count_slow_cpus(unsigned long speed_limit) +{ + unsigned int cnt = 0; + int i; + + for_each_online_cpu(i) + if (target_cpu_speed[i] <= speed_limit) + cnt++; + return cnt; +} + unsigned int tegra_get_slowest_cpu_n(void) { unsigned int cpu = nr_cpu_ids; unsigned long rate = ULONG_MAX; |