From patchwork Fri Oct 4 20:57:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 2990231 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C73AF9F1C3 for ; Fri, 4 Oct 2013 20:58:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C08792030D for ; Fri, 4 Oct 2013 20:58:38 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AD41520306 for ; Fri, 4 Oct 2013 20:58:37 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VSCSG-0006UW-Lx; Fri, 04 Oct 2013 20:58:32 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VSCSE-0007AM-ET; Fri, 04 Oct 2013 20:58:30 +0000 Received: from mail-la0-f42.google.com ([209.85.215.42]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VSCSA-00079X-5D for linux-arm-kernel@lists.infradead.org; Fri, 04 Oct 2013 20:58:26 +0000 Received: by mail-la0-f42.google.com with SMTP id ep20so3771398lab.1 for ; Fri, 04 Oct 2013 13:58:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=c9QQk/VKHBFqpxRUizRcxoYk9SqAwBWV5mlcrBu+8us=; b=U4e8VUp+6NSf0wyXb2CAbDQ914ShtqP05MHnE/5/7gLyV6g+7Stmu/Z4sruiotjhov xFt4L5X0FmS3euyvnGURrtnXguumV2MXP/xHKBnou3NYlIIGYZXvuI4wf2S33e4/7IdQ scAhS6QC72fYJ5oTejuircvDIMCk3O9/RYQX2QWhd0u3E82komppd6BWTnoZqUnE/ARt UgwediTx99ChM+d2nxmDSsW5AP+UYu1XkqFpp9IM+WhehZRIS5fZjbkE90qsqAd/NcVI T1vykg9crT5k/kTBeq7HKde34QoXx5gSmOwBMbITl6EId3NgLl7usAeVzFrIaIlmC+kP hRVQ== X-Gm-Message-State: ALoCoQnA1ZEAsFk2/L+w0wYJulZcliv2X4FJPNY5Vp272RsrVQ3ecmo5lO9PdV7HhqaMn9nbos8r X-Received: by 10.112.0.242 with SMTP id 18mr12988209lbh.18.1380920283584; Fri, 04 Oct 2013 13:58:03 -0700 (PDT) Received: from localhost.localdomain (5-1-13-29-dynamic.retail.datagroup.ua. [5.1.13.29]) by mx.google.com with ESMTPSA id w10sm9967109lbv.6.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Oct 2013 13:58:03 -0700 (PDT) From: Taras Kondratiuk To: Russell King , Will Deacon Subject: [RFC PATCH v2] ARM: OMAP4/highbank: Flush L2 cache before disabling Date: Fri, 4 Oct 2013 23:57:57 +0300 Message-Id: <1380920277-31622-1-git-send-email-taras.kondratiuk@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131004_165826_371217_4108FFAD X-CRM114-Status: GOOD ( 13.32 ) X-Spam-Score: -2.6 (--) Cc: linux-omap@vger.kernel.org, linaro-kernel@lists.linaro.org, linux-arm-kernel@lists.infradead.org, Rob Herring X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Kexec disables outer cache before jumping to reboot code, but it doesn't flush it explicitly. Flush is done implicitly inside of l2x0_disable(). But some SoC's override default .disable handler and don't flush cache. This may lead to a corrupted memory during Kexec reboot on these platforms. This patch adds cache flush inside of OMAP4 and Highbank outer_cache.disable() handlers to make it consistent with default l2x0_disable(). Also it removes redundant outer_flush_all() call just before outer_disable(). Signed-off-by: Taras Kondratiuk Acked-by: Rob Herring Acked-by: Santosh Shilimkar --- v2: Make the fix specific to platforms that don't use l2x0_disable(). v1: https://patchwork.kernel.org/patch/2974431/ --- Cc: Will Deacon Cc: Russell King Cc: Rob Herring Cc: linaro-kernel@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-omap@vger.kernel.org --- arch/arm/mach-highbank/highbank.c | 1 + arch/arm/mach-highbank/pm.c | 1 - arch/arm/mach-omap2/omap4-common.c | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c index 8e63ccd..22e6f34 100644 --- a/arch/arm/mach-highbank/highbank.c +++ b/arch/arm/mach-highbank/highbank.c @@ -63,6 +63,7 @@ void highbank_set_cpu_jump(int cpu, void *jump_addr) static void highbank_l2x0_disable(void) { + outer_flush_all(); /* Disable PL310 L2 Cache controller */ highbank_smc1(0x102, 0x0); } diff --git a/arch/arm/mach-highbank/pm.c b/arch/arm/mach-highbank/pm.c index 04eddb4..9a5b8a7 100644 --- a/arch/arm/mach-highbank/pm.c +++ b/arch/arm/mach-highbank/pm.c @@ -28,7 +28,6 @@ static int highbank_suspend_finish(unsigned long val) { - outer_flush_all(); outer_disable(); highbank_set_pwr_suspend(); diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c index 5791143..3f44b16 100644 --- a/arch/arm/mach-omap2/omap4-common.c +++ b/arch/arm/mach-omap2/omap4-common.c @@ -163,6 +163,7 @@ void __iomem *omap4_get_l2cache_base(void) static void omap4_l2x0_disable(void) { + outer_flush_all(); /* Disable PL310 L2 Cache controller */ omap_smc1(0x102, 0x0); }