ARM: 6043/1: AT91 slow-clock resume: Don't wait for a disabled PLL to lock

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Monday, April 12, 2010 - 7:59 pm

Gitweb:     http://git.kernel.org/linus/9823f1a8463fb631fe965110fe19adeb3df239c4
Commit:     9823f1a8463fb631fe965110fe19adeb3df239c4
Parent:     bb3c9d4f851d51bb6302ef0df830dcec88d7c529
Author:     Anders Larsen <al@alarsen.net>
AuthorDate: Thu Apr 8 11:48:16 2010 +0100
Committer:  Russell King <rmk+kernel@arm.linux.org.uk>
CommitDate: Fri Apr 9 08:31:04 2010 +0100

    ARM: 6043/1: AT91 slow-clock resume: Don't wait for a disabled PLL to lock
    
    at91 slow-clock resume: Don't wait for a disabled PLL to lock.
    
    We run into this problem with the PLLB on the at91: ohci-at91 disables
    the PLLB when going to suspend. The slowclock code however tries to do
    the same: It saves the PLLB register value and when restoring the value
    during resume, it waits for the PLLB to lock again. However the PLL will
    never lock and the loop would run into its timeout because the slowclock
    code just stored and restored an empty register.
    This fixes the problem by only restoring PLLA/PLLB when they were enabled
    at suspend time.
    
    Cc: Andrew Victor <avictor.za@gmail.com>
    Signed-off-by: Anders Larsen <al@alarsen.net>
    Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
 arch/arm/mach-at91/pm_slowclock.S |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-at91/pm_slowclock.S b/arch/arm/mach-at91/pm_slowclock.S
index 987fab3..9fcbd6c 100644
--- a/arch/arm/mach-at91/pm_slowclock.S
+++ b/arch/arm/mach-at91/pm_slowclock.S
@@ -205,13 +205,25 @@ ENTRY(at91_slow_clock)
 	ldr	r3, .saved_pllbr
 	str	r3, [r1, #(AT91_CKGR_PLLBR - AT91_PMC)]
 
+	tst	r3, #(AT91_PMC_MUL &  0xff0000)
+	bne	1f
+	tst	r3, #(AT91_PMC_MUL & ~0xff0000)
+	beq	2f
+1:
 	wait_pllblock
+2:
 
 	/* Restore PLLA setting */
 	ldr	r3, .saved_pllar
 	str	r3, [r1, #(AT91_CKGR_PLLAR - AT91_PMC)]
 
+	tst	r3, #(AT91_PMC_MUL &  0xff0000)
+	bne	3f
+	tst	r3, #(AT91_PMC_MUL & ~0xff0000)
+	beq	4f
+3:
 	wait_pllalock
+4:
 
 #ifdef SLOWDOWN_MASTER_CLOCK
 	/*
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
ARM: 6043/1: AT91 slow-clock resume: Don't wait for a disa ..., Linux Kernel Mailing ..., (Mon Apr 12, 7:59 pm)