From patchwork Thu Dec 13 14:32:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 1874351 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id D83B43FC64 for ; Thu, 13 Dec 2012 14:36:48 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Tj9qf-0001nk-K6; Thu, 13 Dec 2012 14:33:17 +0000 Received: from moutng.kundenserver.de ([212.227.126.187]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Tj9qc-0001nQ-Dn for linux-arm-kernel@lists.infradead.org; Thu, 13 Dec 2012 14:33:15 +0000 Received: from axis700.grange (dslb-146-060-254-132.pools.arcor-ip.net [146.60.254.132]) by mrelayeu.kundenserver.de (node=mrbap3) with ESMTP (Nemesis) id 0LfjPW-1TLMUG2sOY-00okIK; Thu, 13 Dec 2012 15:32:47 +0100 Received: by axis700.grange (Postfix, from userid 1000) id 3DC9A40B99; Thu, 13 Dec 2012 15:32:46 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by axis700.grange (Postfix) with ESMTP id 3191840B98; Thu, 13 Dec 2012 15:32:46 +0100 (CET) Date: Thu, 13 Dec 2012 15:32:46 +0100 (CET) From: Guennadi Liakhovetski X-X-Sender: lyakh@axis700.grange To: Will Deacon Subject: Re: [RFC PATCH v2 3/5] ARM: kernel: update cpu_suspend code to use cache LoUIS operations In-Reply-To: <20121213105109.GB26540@mudshark.cambridge.arm.com> Message-ID: References: <20120919134658.GA2111@linaro.org> <20120920102514.GD4588@e102568-lin.cambridge.arm.com> <20120920110439.GB2117@linaro.org> <20121211163313.GG16759@mudshark.cambridge.arm.com> <20121211163843.GH16759@mudshark.cambridge.arm.com> <50C7C16B.7050106@codeaurora.org> <20121212103338.GB23022@e102568-lin.cambridge.arm.com> <20121212133650.GJ6195@mudshark.cambridge.arm.com> <20121213105109.GB26540@mudshark.cambridge.arm.com> MIME-Version: 1.0 X-Provags-ID: V02:K0:IYy8yljryMf81mX4LbQFOyxNGCGOVArqto6iUJKaxoh I19fARIfTIpRlXmgZgU8o6xPeFztkXDmEAzpHL8qrtV2YQRRpH y0HjxHx/fI/i3RCtTkRY1nbGlfCLF/y3g5mjQWgKsPBZXf1ne/ Q6EI7WuOGxHQGMN2hmcXPECVGGHDRZy4MAn59n0R+SSZKv50x5 77H2qhlRM09yOnpi5YOcCb2uR6EF6pxwI4C9EbDYn4IU3pwUpf 6j7gIGMegSL762QO+s4ntRI7n6k45geY7lkjmxokJyi2IvPd9U hKjoSMlw10gKVoOD5MGAQg6975gxgNBD2cQfi7QS6pfeJbcaqT pfmrJ5OxX00Vr3DHB6lB4eZPqzm4GaC5erCbKfTjt/LmXyn2QK 3VAA9yw9Vdd6A== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121213_093314_761839_F5EB7BFB X-CRM114-Status: GOOD ( 20.47 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (g.liakhovetski[at]gmx.de) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.126.187 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Nicolas Pitre , Dave Martin , Lorenzo Pieralisi , Russell King , "linux-sh@vger.kernel.org" , Catalin Marinas , Daniel Lezcano , Stephen Boyd , Amit Kucheria , Simon Horman , Santosh Shilimkar , Colin Cross , "linux-omap@vger.kernel.org" , Wenzeng Chen , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 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 On Thu, 13 Dec 2012, Will Deacon wrote: > On Thu, Dec 13, 2012 at 08:09:33AM +0000, Guennadi Liakhovetski wrote: > > On Wed, 12 Dec 2012, Will Deacon wrote: > > > Back to the case in hand.... Lorenzo just pointed out to me that the > > > finished in question (sh7372_do_idle_sysc) calls v7_flush_dcache_all, so > > > the louis stuff should be irrelevant. The problem may actually be that the > > > finisher disables the L2 cache prior to cleaning/invalidating it, which is > > > the opposite order to that described by the A8 TRM. > > > > > > Guennadi -- can you try moving the kernel_flush call before the L2 disable > > > in sh7372_do_idle_sysc please? > > > > Yes, this works too. > > That's good to know. Please can you send a patch for that? The sequence > currently being used by the finisher *is* buggy, and should be fixed > independently of the louis stuff. Well, the fix is yours, so, it should be "From: you." I can certainly send it just copying your description above, but I'd also need your Sob. Something like the below (feel free to improve the subject line and the description): From: Will Deacon Subject: [PATCH] ARM: sh7372: fix cache clean / invalidate order According to the Cortex A8 TRM the L2 cache should be first cleaned and then disabled. Fix the swapped order on sh7372. Signed-off-by: Signed-off-by: Guennadi Liakhovetski (or even just) Tested-by: Guennadi Liakhovetski Reviewed-by: Santosh Shilimkar diff --git a/arch/arm/mach-shmobile/sleep-sh7372.S b/arch/arm/mach-shmobile/sleep-sh7372.S index 1d56467..df15d8a 100644 --- a/arch/arm/mach-shmobile/sleep-sh7372.S +++ b/arch/arm/mach-shmobile/sleep-sh7372.S @@ -59,16 +59,16 @@ sh7372_do_idle_sysc: mcr p15, 0, r0, c1, c0, 0 isb - /* disable L2 cache in the aux control register */ - mrc p15, 0, r10, c1, c0, 1 - bic r10, r10, #2 - mcr p15, 0, r10, c1, c0, 1 - /* * Invalidate data cache again. */ ldr r1, kernel_flush blx r1 + + /* disable L2 cache in the aux control register */ + mrc p15, 0, r10, c1, c0, 1 + bic r10, r10, #2 + mcr p15, 0, r10, c1, c0, 1 /* * The kernel doesn't interwork: v7_flush_dcache_all in particluar will * always return in Thumb state when CONFIG_THUMB2_KERNEL is enabled.