From patchwork Fri Sep 21 01:04:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 1488621 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id CABE3DF2D2 for ; Fri, 21 Sep 2012 01:13:04 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TErm2-0007W0-4c; Fri, 21 Sep 2012 01:11:18 +0000 Received: from kirsty.vergenet.net ([202.4.237.240]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TErly-0007VC-4N for linux-arm-kernel@lists.infradead.org; Fri, 21 Sep 2012 01:11:15 +0000 Received: from ayumi.akashicho.tokyo.vergenet.net (p6117-ipbfp1901kobeminato.hyogo.ocn.ne.jp [114.172.117.117]) by kirsty.vergenet.net (Postfix) with ESMTP id 94CFF25BE76; Fri, 21 Sep 2012 11:11:11 +1000 (EST) Received: by ayumi.akashicho.tokyo.vergenet.net (Postfix, from userid 7100) id 0A565EDE5B0; Fri, 21 Sep 2012 10:04:04 +0900 (JST) Date: Fri, 21 Sep 2012 10:04:04 +0900 From: Simon Horman To: Catalin Marinas Subject: Re: [PATCH 1/2] arm: Add ARM ERRATA 775420 workaround Message-ID: <20120921010404.GJ21660@verge.net.au> References: <1347434097-7924-1-git-send-email-horms@verge.net.au> <1347434097-7924-2-git-send-email-horms@verge.net.au> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Organisation: Horms Solutions Ltd. User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Note: CRM114 invocation failed 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.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [202.4.237.240 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Paul Mundt , Magnus Damm , linux-arm-kernel@lists.infradead.org, Russell King , linux-sh@vger.kernel.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, Sep 20, 2012 at 10:58:53AM +0100, Catalin Marinas wrote: > On 12 September 2012 08:14, Simon Horman wrote: > > +config ARM_ERRATA_775420 > > + bool "ARM errata: A data cache maintenance operation which aborts, might lead to deadlock" > > + depends on CPU_V7 > > + help > > + This option enables the workaround for the 775420 Cortex-A9 (r2p2, > > + r2p6,r2p8,r2p10,r3p0) erratum. In case a date cache maintenance > > + operation aborts with MMU exception, it might cause the processor > > + deadlock. This workaround puts DSB before executing ISB at the > > + beginning of the abort exception handler. > > + > > endmenu > > The only case where we can get an abort on cache maintenance is > v7_coherent_user_range(). I don't think we have any ISB on the > exception handling path for this function, so we could just add the > DSB there: I think that an advantage of Abe-san's implementation is that it might to be a bit more robust. But your proposal is certainly much cleaner and for that reason I agree it is a good option. I've updated the patch, but since the code is now all yours I'm unsure if the author should be changed or not. ---------------------------------------------------------------- From: Kouei Abe arm: Add ARM ERRATA 775420 workaround Workaround for the 775420 Cortex-A9 (r2p2, r2p6,r2p8,r2p10,r3p0) erratum. In case a date cache maintenance operation aborts with MMU exception, it might cause the processor to deadlock. This workaround puts DSB before executing ISB if an abort may occur on cache maintenance. Based on work by Kouei Abe and feedback from Catalin Marinas. Cc: Catalin Marinas Signed-off-by: Kouei Abe Signed-off-by: Simon Horman Acked-by: Catalin Marinas --- v2 * Add some details to changelog entry * Alternate implementation suggested by Catalin Marinas - Add the dsb directly to v7_coherent_user_range() rather than the exception handler --- arch/arm/Kconfig | 10 ++++++++++ arch/arm/mm/cache-v7.S | 3 +++ 2 files changed, 13 insertions(+) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 2f88d8d..48c19d4 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1413,6 +1413,16 @@ config PL310_ERRATA_769419 on systems with an outer cache, the store buffer is drained explicitly. +config ARM_ERRATA_775420 + bool "ARM errata: A data cache maintenance operation which aborts, might lead to deadlock" + depends on CPU_V7 + help + This option enables the workaround for the 775420 Cortex-A9 (r2p2, + r2p6,r2p8,r2p10,r3p0) erratum. In case a date cache maintenance + operation aborts with MMU exception, it might cause the processor + to deadlock. This workaround puts DSB before executing ISB if + an abort may occur on cache maintenance. + endmenu source "arch/arm/common/Kconfig" diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S index 39e3fb3..3b17227 100644 --- a/arch/arm/mm/cache-v7.S +++ b/arch/arm/mm/cache-v7.S @@ -211,6 +211,9 @@ ENTRY(v7_coherent_user_range) * isn't mapped, fail with -EFAULT. */ 9001: +#ifdef CONFIG_ARM_ERRATA_775420 + dsb +#endif mov r0, #-EFAULT mov pc, lr UNWIND(.fnend )