Skip to contentSkip to conversation

OMAP2+: PM: Warn users of sleep_while_idle if !CONFIG_CPU_IDLE

PATCH New Rajendra Nayak 2 participants 3 messages Feb 16, 2011 – Mar 3, 2011

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

PATCH 1/1 OMAP2+: PM: Warn users of sleep_while_idle if !CONFIG_CPU_IDLE

This should help users who do a
'echo 1 > /debug/pm_debug/sleep_while_idle' with a config which has !CONFIG_CPU_IDLE and wonder why OMAP is'nt sleeping in idle.

---
 arch/arm/mach-omap2/pm-debug.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/pm-debug.c +9 -0
index 125f565..1e722a0 100644
@@ -569,6 +569,10 @@ static int option_get(void *data, u64 *val)
 
 	*val = *option;
 
+#ifndef CONFIG_CPU_IDLE
+	if (option == &sleep_while_idle)
+		pr_warn("CONFIG_CPU_IDLE is not enabled\n");
+#endif
 	return 0;
 }
 
@@ -581,6 +585,11 @@ static int option_set(void *data, u64 val)
 
 	*option = val;
 
+#ifndef CONFIG_CPU_IDLE
+	if (option == &sleep_while_idle)
+		pr_warn("CONFIG_CPU_IDLE is not enabled\n");
+#endif
+
 	if (option == &enable_off_mode) {
 		if (val)
 			omap_pm_enable_off_mode();
Signature · 1 line
1.7.0.4
#1 lore raw

PATCH 1/1 OMAP2+: PM: Warn users of sleep_while_idle if !CONFIG_CPU_IDLE

Quoted 4 lines · Rajendra Nayak

This should help users who do a
'echo 1 > /debug/pm_debug/sleep_while_idle' with a config which has !CONFIG_CPU_IDLE and wonder why OMAP is'nt sleeping in idle.

This isn't quite right, as 'sleep_while_idle' is actually a flag for whether or not to call omap_sram_idle() at all.

Even without CPUidle, WFI will still be attempted.

Kevin

Quoted 32 lines
---
 arch/arm/mach-omap2/pm-debug.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/pm-debug.c +9 -0
index 125f565..1e722a0 100644
@@ -569,6 +569,10 @@ static int option_get(void *data, u64 *val)
 
 	*val = *option;
 
+#ifndef CONFIG_CPU_IDLE
+	if (option == &sleep_while_idle)
+		pr_warn("CONFIG_CPU_IDLE is not enabled\n");
+#endif
 	return 0;
 }
 
@@ -581,6 +585,11 @@ static int option_set(void *data, u64 val)
 
 	*option = val;
 
+#ifndef CONFIG_CPU_IDLE
+	if (option == &sleep_while_idle)
+		pr_warn("CONFIG_CPU_IDLE is not enabled\n");
+#endif
+
 	if (option == &enable_off_mode) {
 		if (val)
 			omap_pm_enable_off_mode();
#2 lore raw

PATCH 1/1 OMAP2+: PM: Warn users of sleep_while_idle if !CONFIG_CPU_IDLE

Quoted 9 lines · Kevin Hilman
Quoted 4 lines · Rajendra Nayak

This should help users who do a
'echo 1> /debug/pm_debug/sleep_while_idle' with a config which has !CONFIG_CPU_IDLE and wonder why OMAP is'nt sleeping in idle.

This isn't quite right, as 'sleep_while_idle' is actually a flag for whether or not to call omap_sram_idle() at all.

Hi Kevin,

I know this is used in 'omap3_pm_idle' as well
to decide whether or not to call omap_sram_idle() but I was'nt quite sure what omap3_pm_idle is expected to do in the first place.
We end up calling omap_sram_idle here without really programming any target state. Do we really need this to happen, instead can't we just rely on ARM generic code to do a WFI in case we don't have cpuidle support enabled?

regards,
Rajendra

Quoted 37 lines

Even without CPUidle, WFI will still be attempted.

Kevin

Quoted 32 lines
---
  arch/arm/mach-omap2/pm-debug.c |    9 +++++++++
  1 files changed, 9 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/pm-debug.c +9 -0
index 125f565..1e722a0 100644
@@ -569,6 +569,10 @@ static int option_get(void *data, u64 *val)
 
  	*val = *option;
 
+#ifndef CONFIG_CPU_IDLE
+	if (option ==&sleep_while_idle)
+		pr_warn("CONFIG_CPU_IDLE is not enabled\n");
+#endif
  	return 0;
  }
 
@@ -581,6 +585,11 @@ static int option_set(void *data, u64 val)
 
  	*option = val;
 
+#ifndef CONFIG_CPU_IDLE
+	if (option ==&sleep_while_idle)
+		pr_warn("CONFIG_CPU_IDLE is not enabled\n");
+#endif
+
  	if (option ==&enable_off_mode) {
  		if (val)
  			omap_pm_enable_off_mode();