Skip to contentSkip to conversation

OMAP3: PM: cpu-omap: Check governor limits before applying mpu frequency

PATCH In review Eduardo Valentin 3 participants 3 messages Mar 24, 2010 – Apr 5, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 OMAP3: PM: cpu-omap: Check governor limits before applying mpu frequency

From: Eduardo Valentin <[email protected]>

This patch fix the sequence inside omap_target while setting a frequency for OMAP3 devices.

Previously any frequency was set, even if out of range. Now the range set by the governor is also checked for OMAP3.

---
 arch/arm/plat-omap/cpu-omap.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/arm/plat-omap/cpu-omap.c +2 -1
index a69b557..0674405 100644
@@ -88,7 +88,7 @@ static int omap_target(struct cpufreq_policy *policy,
 	struct cpufreq_freqs freqs;
 #endif
 #if defined(CONFIG_ARCH_OMAP3) && !defined(CONFIG_OMAP_PM_NONE)
-	unsigned long freq = target_freq * 1000;
+	unsigned long freq;
 #endif
 	int ret = 0;
 
@@ -114,6 +114,7 @@ static int omap_target(struct cpufreq_policy *policy,
 	ret = clk_set_rate(mpu_clk, freqs.new * 1000);
 	cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 #elif defined(CONFIG_ARCH_OMAP3) && !defined(CONFIG_OMAP_PM_NONE)
+	freq = target_freq * 1000;
 	if (opp_find_freq_ceil(OPP_MPU, &freq))
 		omap_pm_cpu_set_freq(freq);
 #endif
Signature · 1 line
1.7.0.2
Acked-by on v1 1/1
#1 lore raw

Eduardo Valentin had written, on 03/24/2010 06:02 AM, the following:

Quoted 9 lines

From: Eduardo Valentin <[email protected]>

This patch fix the sequence inside omap_target while setting a frequency for OMAP3 devices.

Previously any frequency was set, even if out of range. Now the range set by the governor is also checked for OMAP3.

Good catch. thanks.

Quoted 25 lines
---
 arch/arm/plat-omap/cpu-omap.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/arm/plat-omap/cpu-omap.c +2 -1
index a69b557..0674405 100644
@@ -88,7 +88,7 @@ static int omap_target(struct cpufreq_policy *policy,
 	struct cpufreq_freqs freqs;
 #endif
 #if defined(CONFIG_ARCH_OMAP3) && !defined(CONFIG_OMAP_PM_NONE)
-	unsigned long freq = target_freq * 1000;
+	unsigned long freq;
 #endif
 	int ret = 0;
 
@@ -114,6 +114,7 @@ static int omap_target(struct cpufreq_policy *policy,
 	ret = clk_set_rate(mpu_clk, freqs.new * 1000);
 	cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 #elif defined(CONFIG_ARCH_OMAP3) && !defined(CONFIG_OMAP_PM_NONE)
+	freq = target_freq * 1000;
 	if (opp_find_freq_ceil(OPP_MPU, &freq))
 		omap_pm_cpu_set_freq(freq);
 #endif
Signature · 2 lines
Regards,
Nishanth Menon
#2 lore raw
Quoted 6 lines · Nishanth Menon

Eduardo Valentin had written, on 03/24/2010 06:02 AM, the following:

Quoted 5 lines

From: Eduardo Valentin <[email protected]>

This patch fix the sequence inside omap_target while setting a frequency for OMAP3 devices.

Quoted 7 lines
Quoted 4 lines

Previously any frequency was set, even if out of range. Now the range set by the governor is also checked for OMAP3.

Good catch. thanks.

Thanks, applying to pm-wip-opp (which I'm still trying to find the time to rebase for upstream)

Kevin