From patchwork Wed Dec 12 10:31:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 1865431 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 17F29DF2EE for ; Wed, 12 Dec 2012 10:31:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753531Ab2LLKbZ (ORCPT ); Wed, 12 Dec 2012 05:31:25 -0500 Received: from cam-admin0.cambridge.arm.com ([217.140.96.50]:62670 "EHLO cam-admin0.cambridge.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751494Ab2LLKbY (ORCPT ); Wed, 12 Dec 2012 05:31:24 -0500 Received: from mudshark.cambridge.arm.com (mudshark.cambridge.arm.com [10.1.79.58]) by cam-admin0.cambridge.arm.com (8.12.6/8.12.6) with ESMTP id qBCAVKki019357; Wed, 12 Dec 2012 10:31:21 GMT Date: Wed, 12 Dec 2012 10:31:20 +0000 From: Will Deacon To: Stephen Boyd Cc: Guennadi Liakhovetski , Nicolas Pitre , Dave Martin , Lorenzo Pieralisi , Russell King , "linux-sh@vger.kernel.org" , Catalin Marinas , Daniel Lezcano , Amit Kucheria , Simon Horman , Santosh Shilimkar , Colin Cross , "linux-omap@vger.kernel.org" , Wenzeng Chen , "linux-arm-kernel@lists.infradead.org" Subject: Re: [RFC PATCH v2 3/5] ARM: kernel: update cpu_suspend code to use cache LoUIS operations Message-ID: <20121212103119.GA6195@mudshark.cambridge.arm.com> References: <1347986135-17979-1-git-send-email-lorenzo.pieralisi@arm.com> <1347986135-17979-4-git-send-email-lorenzo.pieralisi@arm.com> <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> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <50C7C16B.7050106@codeaurora.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org On Tue, Dec 11, 2012 at 11:27:39PM +0000, Stephen Boyd wrote: > On 12/11/12 08:38, Will Deacon wrote: > > diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S > > index cd95664..f58248f 100644 > > --- a/arch/arm/mm/cache-v7.S > > +++ b/arch/arm/mm/cache-v7.S > > @@ -44,7 +44,8 @@ ENDPROC(v7_flush_icache_all) > > ENTRY(v7_flush_dcache_louis) > > dmb @ ensure ordering with previous memory accesses > > mrc p15, 1, r0, c0, c0, 1 @ read clidr, r0 = clidr > > - ands r3, r0, #0xe00000 @ extract LoUIS from clidr > > + ALT_SMP(ands r3, r0, #(7 << 21)) @ extract LoUIS from clidr > > + ALT_UP(ands r3, r0, #(7 << 27)) @ extract LoUU from clidr > > mov r3, r3, lsr #20 @ r3 = LoUIS * 2 > > You need to fix this mov as well, right? Ha, nice catch. So the original patch ended up with a ridiculously high level number and would've flushed L2, hence we will need to retest with the fix below... Will --->8 --- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S index cd95664..7539ec2 100644 --- a/arch/arm/mm/cache-v7.S +++ b/arch/arm/mm/cache-v7.S @@ -44,8 +44,10 @@ ENDPROC(v7_flush_icache_all) ENTRY(v7_flush_dcache_louis) dmb @ ensure ordering with previous memory accesses mrc p15, 1, r0, c0, c0, 1 @ read clidr, r0 = clidr - ands r3, r0, #0xe00000 @ extract LoUIS from clidr - mov r3, r3, lsr #20 @ r3 = LoUIS * 2 + ALT_SMP(ands r3, r0, #(7 << 21)) @ extract LoUIS from clidr + ALT_UP(ands r3, r0, #(7 << 27)) @ extract LoUU from clidr + ALT_SMP(mov r3, r3, lsr #20) @ r3 = LoUIS * 2 + ALT_UP(mov r3, r3, lsr #26) @ r3 = LoUU * 2 moveq pc, lr @ return if level == 0 mov r10, #0 @ r10 (starting level) = 0 b flush_levels @ start flushing cache levels