From 5d87efe99b0659df8afdc56be9f6338d48621ac9 Mon Sep 17 00:00:00 2001 From: Wen Yi Date: Wed, 31 Aug 2011 13:50:10 -0700 Subject: arm: tegra: set cpu0 governor only for t30 The cpufreq sysfs entry for cpus other than cpu0 in T30 is populated when the cpu becomes online and removed when the cpu becomes offline. This caused race condition between setting cpu governor and bringing cpu offline. The solution is to change the governor for cpu0 only. BUG 865113 Change-Id: I36d3f9795c0a1ec51bcde00a497ec85864dc2573 Reviewed-on: http://git-master/r/50155 Reviewed-by: Rohan Somvanshi Tested-by: Rohan Somvanshi --- arch/arm/mach-tegra/common.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c index 45ed7344e996..4661f9e1d368 100644 --- a/arch/arm/mach-tegra/common.c +++ b/arch/arm/mach-tegra/common.c @@ -794,7 +794,7 @@ static void cpufreq_set_governor(char *governor) struct file *scaling_gov = NULL; mm_segment_t old_fs; char buf[128]; - int i; + int i = 0; loff_t offset = 0; if (governor == NULL) @@ -804,7 +804,10 @@ static void cpufreq_set_governor(char *governor) old_fs = get_fs(); set_fs(KERNEL_DS); - for_each_online_cpu(i) { +#ifndef CONFIG_TEGRA_AUTO_HOTPLUG + for_each_online_cpu(i) +#endif + { sprintf(buf, cpufreq_sysfs_place_holder, i); scaling_gov = filp_open(buf, O_RDWR, 0); if (IS_ERR_OR_NULL(scaling_gov)) { -- cgit v1.2.3