From patchwork Tue Jan 29 10:16:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: srinidhi kasagar X-Patchwork-Id: 2060871 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 BCBD9DF23E for ; Tue, 29 Jan 2013 10:19:37 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U08FS-0001HA-Vu; Tue, 29 Jan 2013 10:17:02 +0000 Received: from eu1sys200aog110.obsmtp.com ([207.126.144.129]) by merlin.infradead.org with smtps (Exim 4.76 #1 (Red Hat Linux)) id 1U08FN-0001A2-Uq for linux-arm-kernel@lists.infradead.org; Tue, 29 Jan 2013 10:16:59 +0000 Received: from beta.dmz-us.st.com ([167.4.1.35]) (using TLSv1) by eu1sys200aob110.postini.com ([207.126.147.11]) with SMTP ID DSNKUQeheocMDWyostc97DHOGrae77eCwrma@postini.com; Tue, 29 Jan 2013 10:16:50 UTC Received: from zeta.dmz-us.st.com (ns4.st.com [167.4.16.71]) by beta.dmz-us.st.com (STMicroelectronics) with ESMTP id 4BBD54D; Tue, 29 Jan 2013 10:15:38 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-us.st.com (STMicroelectronics) with ESMTP id 25FA891; Tue, 29 Jan 2013 04:29:14 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id 4B1D724C2F6; Tue, 29 Jan 2013 11:16:17 +0100 (CET) Received: from localhost (10.201.54.34) by exdcvycastm022.EQ1STM.local (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.3.83.0; Tue, 29 Jan 2013 11:16:22 +0100 Date: Tue, 29 Jan 2013 15:46:19 +0530 From: srinidhi kasagar To: Subject: [PATCH v2 4/5] ARM: Handle l2x0 quirks in cpu_idle path Message-ID: <20130129101616.GA21952@bnru10> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130129_051658_270060_04DE910A X-CRM114-Status: GOOD ( 14.96 ) X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [207.126.144.129 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linux@arm.linux.org.uk 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 As a result of to-be deprecated "CONFIG_PL310_ERRATA_*" config option, handle the quirks at run time. As of now, PL310 errata 769419 is managed this way. Signed-off-by: srinidhi kasagar --- arch/arm/include/asm/hardware/cache-l2x0.h | 13 +++++++++++++ arch/arm/kernel/process.c | 7 ++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/arch/arm/include/asm/hardware/cache-l2x0.h b/arch/arm/include/asm/hardware/cache-l2x0.h index ab76131..7cca69c 100644 --- a/arch/arm/include/asm/hardware/cache-l2x0.h +++ b/arch/arm/include/asm/hardware/cache-l2x0.h @@ -136,6 +136,19 @@ struct l2x0_regs { extern struct l2x0_regs l2x0_saved_regs; extern u32 l2x0_revision; +#ifdef CONFIG_CACHE_PL310 +static inline void handle_l2x0_quirks(void) +{ + /* handle ERRATA_769419 */ + if (l2x0_revision == L2X0_CACHE_ID_RTL_R3P0) + wmb(); +} +#else +static inline void handle_l2x0_quirks(void) +{ +} +#endif + #endif /* __ASSEMBLY__ */ #endif diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index c6dec5f..12e3b5f 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c @@ -39,6 +39,7 @@ #include #include #include +#include #ifdef CONFIG_CC_STACKPROTECTOR #include @@ -201,9 +202,9 @@ void cpu_idle(void) * to ensure we don't miss a wakeup call. */ local_irq_disable(); -#ifdef CONFIG_PL310_ERRATA_769419 - wmb(); -#endif + + handle_l2x0_quirks(); + if (hlt_counter) { local_irq_enable(); cpu_relax();