From patchwork Thu Jun 9 17:53:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King - ARM Linux X-Patchwork-Id: 866362 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p59Hs77e025059 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 9 Jun 2011 17:54:28 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QUjQV-0003GB-1W; Thu, 09 Jun 2011 17:53:51 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QUjQU-0003l1-KM; Thu, 09 Jun 2011 17:53:50 +0000 Received: from [2002:4e20:1eda::1] (helo=caramon.arm.linux.org.uk) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QUjQR-0003kh-2j for linux-arm-kernel@lists.infradead.org; Thu, 09 Jun 2011 17:53:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=caramon; h=Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=a/i+Wfk7xRbjzObf5duuvxkYgrWLUhZ2ZVCGk8INkQM=; b=B7mzUSWspcJAp3e/BeNBXMSY/B6TGy0jUy2Kizy7Z8DPr7ou5Uw0T869qFh53E7LbdhlqpfWTHpFOhMuaMipRtvbVikT0TTUQROPwoMkG+u7efvRkk1XibKyisiLI/aENfa6oRQPPFkiBY5xi0RI508zJ2viHpBR6s+uqGN1HrU=; Received: from n2100.arm.linux.org.uk ([2002:4e20:1eda:1:214:fdff:fe10:4f86]) by caramon.arm.linux.org.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1QUjPv-0005cx-Bt; Thu, 09 Jun 2011 18:53:15 +0100 Received: from linux by n2100.arm.linux.org.uk with local (Exim 4.72) (envelope-from ) id 1QUjPu-0008Jc-3H; Thu, 09 Jun 2011 18:53:14 +0100 Date: Thu, 9 Jun 2011 18:53:13 +0100 From: Russell King - ARM Linux To: Santosh Shilimkar Subject: Re: [linux-pm] [RFC PATCH v4] ARM hibernation/suspend-to-disk support Message-ID: <20110609175313.GG24424@n2100.arm.linux.org.uk> References: <201106072348.44624.rjw@sisk.pl> <20110609154058.GA24424@n2100.arm.linux.org.uk> <4DF0F45A.3030103@ti.com> <20110609164024.GB24424@n2100.arm.linux.org.uk> <4DF0FA73.8050607@ti.com> <20110609171255.GD24424@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20110609171255.GD24424@n2100.arm.linux.org.uk> User-Agent: Mutt/1.5.19 (2009-01-05) X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110609_135347_726253_E3A8757E X-CRM114-Status: GOOD ( 20.14 ) X-Spam-Score: 1.2 (+) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (1.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS Cc: Frank Hofmann , "Rafael J. Wysocki" , linux-pm@lists.linux-foundation.org, tuxonice-devel@tuxonice.net, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 09 Jun 2011 17:54:28 +0000 (UTC) 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 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 --- 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