From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [linux-pm] [RFC PATCH v4] ARM hibernation/suspend-to-disk support
Date: Thu, 9 Jun 2011 18:53:13 +0100 [thread overview]
Message-ID: <20110609175313.GG24424@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20110609171255.GD24424@n2100.arm.linux.org.uk>
On Thu, Jun 09, 2011 at 06:12:55PM +0100, Russell King - ARM Linux wrote:
> > 3. Avoid direct write to AUXCTRL in generic suspend code.
>
> This is the only problematical one that I can see. We need to restore
> this on systems running in secure mode. What we could do is rather than
> writing to the register, read it first and compare its value with what
> was saved to see whether we need to write it.
>
> Then, if platforms run in non-secure mode, they are responsible for
> restoring that register back to its pre-suspend value before their
> assembly calls cpu_resume().
And here's a patch which does that:
8<-----------
From: Russell King <rmk+kernel@arm.linux.org.uk>
ARM: Avoid writing to auxctrl register unless it needs to be updated
As the auxiliary control register is not writable in non-secure mode
such as on OMAP, we must avoid writing the register when resuming in
non-secure mode. Avoid this by moving the responsibility to the
SoC code in this case to ensure that the auxiliary control register
is restored before cpu_resume() is called.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
--
arch/arm/mm/proc-v7.S | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
index 3c38678..fa1e6d5 100644
--- a/arch/arm/mm/proc-v7.S
+++ b/arch/arm/mm/proc-v7.S
@@ -237,7 +237,9 @@ ENTRY(cpu_v7_do_resume)
mcr p15, 0, r7, c2, c0, 0 @ TTB 0
mcr p15, 0, r8, c2, c0, 1 @ TTB 1
mcr p15, 0, ip, c2, c0, 2 @ TTB control register
- mcr p15, 0, r10, c1, c0, 1 @ Auxiliary control register
+ mrc p15, 0, r4, c1, c0, 1 @ Read auxiliary control register
+ teq r4, r10
+ mcrne p15, 0, r10, c1, c0, 1 @ Auxiliary control register
mcr p15, 0, r11, c1, c0, 2 @ Co-processor access control
ldr r4, =PRRR @ PRRR
ldr r5, =NMRR @ NMRR
next prev parent reply other threads:[~2011-06-09 17:53 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-07 16:48 [RFC PATCH v4] ARM hibernation/suspend-to-disk support Frank Hofmann
2011-06-07 21:48 ` [linux-pm] " Rafael J. Wysocki
2011-06-09 15:30 ` Frank Hofmann
2011-06-09 15:40 ` Russell King - ARM Linux
2011-06-09 16:26 ` Frank Hofmann
2011-06-09 16:35 ` Santosh Shilimkar
2011-06-09 17:07 ` Frank Hofmann
2011-06-09 17:10 ` Santosh Shilimkar
2011-06-09 17:14 ` Russell King - ARM Linux
2011-06-09 16:27 ` Santosh Shilimkar
2011-06-09 16:40 ` Russell King - ARM Linux
2011-06-09 16:53 ` Santosh Shilimkar
2011-06-09 17:12 ` Russell King - ARM Linux
2011-06-09 17:21 ` Santosh Shilimkar
2011-06-09 17:53 ` Russell King - ARM Linux [this message]
2011-06-21 10:11 ` Russell King - ARM Linux
2011-06-10 12:22 ` Frank Hofmann
2011-06-10 13:43 ` Russell King - ARM Linux
2011-06-10 13:47 ` Frank Hofmann
2011-06-10 14:02 ` Russell King - ARM Linux
2011-06-10 14:54 ` Frank Hofmann
2011-06-09 16:44 ` Frank Hofmann
2011-06-09 16:56 ` Santosh Shilimkar
2011-06-09 16:50 ` Russell King - ARM Linux
2011-06-09 16:53 ` Frank Hofmann
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=20110609175313.GG24424@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--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