linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: nicolas.ferre@atmel.com (Nicolas Ferre)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] pm: at91: pm_slowclock: fix suspend/resume hang up in timeouts
Date: Tue, 3 Mar 2015 19:41:33 +0100	[thread overview]
Message-ID: <54F6005D.6000308@atmel.com> (raw)
In-Reply-To: <1423116037-5921-1-git-send-email-wenyou.yang@atmel.com>

Le 05/02/2015 07:00, Wenyou Yang a ?crit :
> From: Sylvain Rochet <sylvain.rochet@finsecur.com>
> 
> Removed timeout on XTAL, PLL lock and Master Clock Ready, hang if
> something went wrong instead of continuing in unknown condition. There
> is not much we can do if a PLL lock never ends, we are running in SRAM
> and we will not be able to connect back the sdram or ddram in order to
> be able to fire up a message or just panic.
> 
> As a bonus, not decounting the timeout register in slow clock mode
> reduce cumulated suspend time and resume time from ~17ms to ~15ms.
> 
> Signed-off-by: Sylvain Rochet <sylvain.rochet@finsecur.com>
> Acked-by: Wenyou.Yang <wenyou.yang@atmel.com>

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

and stacked in at91-4.0-fixes.
thanks!

> ---
>  arch/arm/mach-at91/pm_slowclock.S |   33 ++++-----------------------------
>  1 file changed, 4 insertions(+), 29 deletions(-)
> 
> diff --git a/arch/arm/mach-at91/pm_slowclock.S b/arch/arm/mach-at91/pm_slowclock.S
> index 2001877..79dfdbe 100644
> --- a/arch/arm/mach-at91/pm_slowclock.S
> +++ b/arch/arm/mach-at91/pm_slowclock.S
> @@ -34,11 +34,6 @@
>   */
>  #undef SLOWDOWN_MASTER_CLOCK
>  
> -#define MCKRDY_TIMEOUT		1000
> -#define MOSCRDY_TIMEOUT 	1000
> -#define PLLALOCK_TIMEOUT	1000
> -#define PLLBLOCK_TIMEOUT	1000
> -
>  pmc	.req	r0
>  sdramc	.req	r1
>  ramc1	.req	r2
> @@ -50,56 +45,36 @@ tmp2	.req	r5
>   * Wait until master clock is ready (after switching master clock source)
>   */
>  	.macro wait_mckrdy
> -	mov	tmp2, #MCKRDY_TIMEOUT
> -1:	sub	tmp2, tmp2, #1
> -	cmp	tmp2, #0
> -	beq	2f
> -	ldr	tmp1, [pmc, #AT91_PMC_SR]
> +1:	ldr	tmp1, [pmc, #AT91_PMC_SR]
>  	tst	tmp1, #AT91_PMC_MCKRDY
>  	beq	1b
> -2:
>  	.endm
>  
>  /*
>   * Wait until master oscillator has stabilized.
>   */
>  	.macro wait_moscrdy
> -	mov	tmp2, #MOSCRDY_TIMEOUT
> -1:	sub	tmp2, tmp2, #1
> -	cmp	tmp2, #0
> -	beq	2f
> -	ldr	tmp1, [pmc, #AT91_PMC_SR]
> +1:	ldr	tmp1, [pmc, #AT91_PMC_SR]
>  	tst	tmp1, #AT91_PMC_MOSCS
>  	beq	1b
> -2:
>  	.endm
>  
>  /*
>   * Wait until PLLA has locked.
>   */
>  	.macro wait_pllalock
> -	mov	tmp2, #PLLALOCK_TIMEOUT
> -1:	sub	tmp2, tmp2, #1
> -	cmp	tmp2, #0
> -	beq	2f
> -	ldr	tmp1, [pmc, #AT91_PMC_SR]
> +1:	ldr	tmp1, [pmc, #AT91_PMC_SR]
>  	tst	tmp1, #AT91_PMC_LOCKA
>  	beq	1b
> -2:
>  	.endm
>  
>  /*
>   * Wait until PLLB has locked.
>   */
>  	.macro wait_pllblock
> -	mov	tmp2, #PLLBLOCK_TIMEOUT
> -1:	sub	tmp2, tmp2, #1
> -	cmp	tmp2, #0
> -	beq	2f
> -	ldr	tmp1, [pmc, #AT91_PMC_SR]
> +1:	ldr	tmp1, [pmc, #AT91_PMC_SR]
>  	tst	tmp1, #AT91_PMC_LOCKB
>  	beq	1b
> -2:
>  	.endm
>  
>  	.text
> 


-- 
Nicolas Ferre

  reply	other threads:[~2015-03-03 18:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-05  5:59 [PATCH 0/3] at91-3.19: pm fixes Wenyou Yang
2015-02-05  6:00 ` [PATCH 1/3] pm: at91: pm_slowclock: fix suspend/resume hang up in timeouts Wenyou Yang
2015-03-03 18:41   ` Nicolas Ferre [this message]
2015-02-05  6:01 ` [PATCH 2/3] pm: at91: pm_slowclock: remove clocks which are already stopped when entering slow clock mode Wenyou Yang
2015-03-03 18:42   ` Nicolas Ferre
2015-03-03 22:50     ` Sylvain Rochet
2015-03-12 15:37       ` Nicolas Ferre
2015-02-05  6:02 ` [PATCH 3/3] pm: at91: Workaround DDRSDRC self-refresh bug with LPDDR1 memories Wenyou Yang
2015-03-03 18:41   ` Nicolas Ferre

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=54F6005D.6000308@atmel.com \
    --to=nicolas.ferre@atmel.com \
    --cc=linux-arm-kernel@lists.infradead.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 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).