linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/3] OMAP3: PM: invoke omap_sram_idle() only when sleep_while_idle is enabled
@ 2009-03-17  7:28 Kim Kyuwon
  2009-03-17 14:53 ` Kevin Hilman
  0 siblings, 1 reply; 3+ messages in thread
From: Kim Kyuwon @ 2009-03-17  7:28 UTC (permalink / raw)
  To: OMAP; +Cc: q1.kim, Kevin Hilman, Jouni Hogander, kyungmin.park

If MPU goes to WFI in the idle thread, execution time becomes a bit
slow and the JTAG Debugger doesn't work. This patch is needed for
urgent works(e.g. booting and launching application) and debugging.

To enable sleep_while_idle mode, use below setting.
echo 1 > /sys/power/sleep_while_idle

Signed-off-by: Kim Kyuwon <q1.kim@samsung.com>
---
 arch/arm/mach-omap2/cpuidle34xx.c |    3 +++
 arch/arm/mach-omap2/pm34xx.c      |    5 +++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/cpuidle34xx.c
b/arch/arm/mach-omap2/cpuidle34xx.c
index 630108c..1623c2f 100644
--- a/arch/arm/mach-omap2/cpuidle34xx.c
+++ b/arch/arm/mach-omap2/cpuidle34xx.c
@@ -87,6 +87,9 @@ static int omap3_enter_idle(struct cpuidle_device *dev,
 	local_irq_disable();
 	local_fiq_disable();

+	if (!enable_dyn_sleep)
+		goto return_sleep_time;
+
 	if (!enable_off_mode) {
 		if (mpu_state < PWRDM_POWER_RET)
 			mpu_state = PWRDM_POWER_RET;
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 9102cee..402409c 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -484,8 +484,6 @@ static int omap3_fclks_active(void)

 int omap3_can_sleep(void)
 {
-	if (!enable_dyn_sleep)
-		return 0;
 	if (!omap_uart_can_sleep())
 		return 0;
 	if (omap3_fclks_active())
@@ -545,6 +543,9 @@ static void omap3_pm_idle(void)
 	local_irq_disable();
 	local_fiq_disable();

+	if (!enable_dyn_sleep)
+		goto out;
+
 	if (!omap3_can_sleep())
 		goto out;

-- 
1.5.2.5


-- 
Kyuwon

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 3/3] OMAP3: PM: invoke omap_sram_idle() only when  sleep_while_idle is enabled
  2009-03-17  7:28 [PATCH 3/3] OMAP3: PM: invoke omap_sram_idle() only when sleep_while_idle is enabled Kim Kyuwon
@ 2009-03-17 14:53 ` Kevin Hilman
  2009-03-18  0:28   ` Kim Kyuwon
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Hilman @ 2009-03-17 14:53 UTC (permalink / raw)
  To: Kim Kyuwon; +Cc: OMAP, q1.kim, Jouni Hogander, kyungmin.park

Kim Kyuwon <chammoru@gmail.com> writes:

> If MPU goes to WFI in the idle thread, execution time becomes a bit
> slow and the JTAG Debugger doesn't work. This patch is needed for
> urgent works(e.g. booting and launching application) and debugging.

Kim,

Do you still need this patch when using the new lower-latency C1-state
patch from Peter which I recently applied to the PM branch?

With that patch, MPU and CORE stay ON, and the clkdomain is not allowed
to idle so that the latency for C1 is on the order of a few usecs.

Kevin

> To enable sleep_while_idle mode, use below setting.
> echo 1 > /sys/power/sleep_while_idle
>
> Signed-off-by: Kim Kyuwon <q1.kim@samsung.com>
> ---
>  arch/arm/mach-omap2/cpuidle34xx.c |    3 +++
>  arch/arm/mach-omap2/pm34xx.c      |    5 +++--
>  2 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/cpuidle34xx.c
> b/arch/arm/mach-omap2/cpuidle34xx.c
> index 630108c..1623c2f 100644
> --- a/arch/arm/mach-omap2/cpuidle34xx.c
> +++ b/arch/arm/mach-omap2/cpuidle34xx.c
> @@ -87,6 +87,9 @@ static int omap3_enter_idle(struct cpuidle_device *dev,
>  	local_irq_disable();
>  	local_fiq_disable();
>
> +	if (!enable_dyn_sleep)
> +		goto return_sleep_time;
> +
>  	if (!enable_off_mode) {
>  		if (mpu_state < PWRDM_POWER_RET)
>  			mpu_state = PWRDM_POWER_RET;
> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
> index 9102cee..402409c 100644
> --- a/arch/arm/mach-omap2/pm34xx.c
> +++ b/arch/arm/mach-omap2/pm34xx.c
> @@ -484,8 +484,6 @@ static int omap3_fclks_active(void)
>
>  int omap3_can_sleep(void)
>  {
> -	if (!enable_dyn_sleep)
> -		return 0;
>  	if (!omap_uart_can_sleep())
>  		return 0;
>  	if (omap3_fclks_active())
> @@ -545,6 +543,9 @@ static void omap3_pm_idle(void)
>  	local_irq_disable();
>  	local_fiq_disable();
>
> +	if (!enable_dyn_sleep)
> +		goto out;
> +
>  	if (!omap3_can_sleep())
>  		goto out;
>
> -- 
> 1.5.2.5
>
>
> -- 
> Kyuwon

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 3/3] OMAP3: PM: invoke omap_sram_idle() only when sleep_while_idle is enabled
  2009-03-17 14:53 ` Kevin Hilman
@ 2009-03-18  0:28   ` Kim Kyuwon
  0 siblings, 0 replies; 3+ messages in thread
From: Kim Kyuwon @ 2009-03-18  0:28 UTC (permalink / raw)
  To: Kevin Hilman
  Cc: OMAP, q1.kim, Jouni Hogander, kyungmin.park,
	Peter 'p2' De Schrijver

On Tue, Mar 17, 2009 at 11:53 PM, Kevin Hilman
<khilman@deeprootsystems.com> wrote:
> Kim Kyuwon <chammoru@gmail.com> writes:
>
>> If MPU goes to WFI in the idle thread, execution time becomes a bit
>> slow and the JTAG Debugger doesn't work. This patch is needed for
>> urgent works(e.g. booting and launching application) and debugging.
>
> Kim,
>
> Do you still need this patch when using the new lower-latency C1-state
> patch from Peter which I recently applied to the PM branch?
>
> With that patch, MPU and CORE stay ON, and the clkdomain is not allowed
> to idle so that the latency for C1 is on the order of a few usecs.
>

No, I don't need this patch.
I confirmed that JTAG debugger works with peter's patch, even though
MPU goes to WFI.

Thanks Keven, Peter!

Kyuwon

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-03-18  0:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-17  7:28 [PATCH 3/3] OMAP3: PM: invoke omap_sram_idle() only when sleep_while_idle is enabled Kim Kyuwon
2009-03-17 14:53 ` Kevin Hilman
2009-03-18  0:28   ` Kim Kyuwon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).