All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@deeprootsystems.com>
To: Jean Pihet <jean.pihet@newoldbits.com>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	Jean Pihet <j-pihet@ti.com>
Subject: Re: [PATCH] OMAP3: disable idle early in the suspend sequence
Date: Mon, 22 Nov 2010 09:51:15 -0800	[thread overview]
Message-ID: <87y68luu0c.fsf@deeprootsystems.com> (raw)
In-Reply-To: <1290422697-2300-1-git-send-email-j-pihet@ti.com> (Jean Pihet's message of "Mon, 22 Nov 2010 11:44:57 +0100")

Jean Pihet <jean.pihet@newoldbits.com> writes:

> Some bad interaction between the idle and the suspend paths has been
> noticed: the idle code is called during the suspend enter and exit
> sequences. This could cause corruption or lock-up of resources.

> The solution is to move the call to disable_hlt at the very beginning
> of the suspend sequence (in omap3_pm_begin instead of omap3_pm_prepare),
> and the call to enable_hlt at the very end of the suspend sequence
> (in omap3_pm_end instead of omap3_pm_finish).
>
> Tested with RET and OFF on Beagle and OMAP3EVM.

I think the description could have a little more detail.  Something like:

Idle path should be disabled during the entire suspend/resume sequence.
Currently it is disabled in ->prepare() and re-enabled in ->finish(),
but the suspend sequence starts with ->begin() and ends with ->end(),
leaving windows where the suspend/resume sequence is still underway and
idle code could execute.

To fix, move idle disable and enable into ->begin() and ->end()
respectively to ensure idle path is disabled for the entire
suspend/resume sequence.

>
> Signed-off-by: Jean Pihet <j-pihet@ti.com>
> Cc: Kevin Hilman <khilman@deeprootsystems.com>
> ---
>  arch/arm/mach-omap2/pm34xx.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
> index 75c0cd1..022fdff 100644
> --- a/arch/arm/mach-omap2/pm34xx.c
> +++ b/arch/arm/mach-omap2/pm34xx.c
> @@ -508,7 +508,6 @@ static suspend_state_t suspend_state;
>  
>  static int omap3_pm_prepare(void)
>  {
> -	disable_hlt();
>  	return 0;
>  }
>  
> @@ -576,12 +575,12 @@ static int omap3_pm_enter(suspend_state_t unused)
>  
>  static void omap3_pm_finish(void)
>  {
> -	enable_hlt();
>  }

Might as well remove these empty functions now.

>  /* Hooks to enable / disable UART interrupts during suspend */
>  static int omap3_pm_begin(suspend_state_t state)
>  {
> +	disable_hlt();
>  	suspend_state = state;
>  	omap_uart_enable_irqs(0);
>  	return 0;
> @@ -591,6 +590,7 @@ static void omap3_pm_end(void)
>  {
>  	suspend_state = PM_SUSPEND_ON;
>  	omap_uart_enable_irqs(1);
> +	enable_hlt();
>  	return;
>  }

Kevin

  parent reply	other threads:[~2010-11-22 17:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-22 10:44 [PATCH] OMAP3: disable idle early in the suspend sequence Jean Pihet
2010-11-22 10:53 ` Rajendra Nayak
2010-11-22 11:30   ` Jean Pihet
2010-11-22 12:35     ` Rajendra Nayak
2010-11-22 11:11 ` Felipe Balbi
2010-11-22 11:38   ` Jean Pihet
2010-11-22 11:45     ` Felipe Balbi
2010-11-22 17:51 ` Kevin Hilman [this message]
2010-11-22 19:40   ` Jean Pihet
2010-12-08  1:11 ` Kevin Hilman
2010-12-08  9:11   ` Jean Pihet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y68luu0c.fsf@deeprootsystems.com \
    --to=khilman@deeprootsystems.com \
    --cc=j-pihet@ti.com \
    --cc=jean.pihet@newoldbits.com \
    --cc=linux-omap@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.