From patchwork Wed Oct 2 11:34:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 2974431 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 73533BFF0B for ; Wed, 2 Oct 2013 11:35:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DF3D42039F for ; Wed, 2 Oct 2013 11:35:34 +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 DE222202A7 for ; Wed, 2 Oct 2013 11:35:29 +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 1VRKi8-00023X-GY; Wed, 02 Oct 2013 11:35:20 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VRKi6-0005Jd-3C; Wed, 02 Oct 2013 11:35:18 +0000 Received: from mail-la0-f43.google.com ([209.85.215.43]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VRKi2-0005J2-Hp for linux-arm-kernel@lists.infradead.org; Wed, 02 Oct 2013 11:35:16 +0000 Received: by mail-la0-f43.google.com with SMTP id ep20so510471lab.30 for ; Wed, 02 Oct 2013 04:34:49 -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=aBGPQJS7Tm+Fyp8tZlX8DaIZaZlHHdDZTqYlLLW5Py8=; b=axMSIrhc72+YtCxmSuiW1ZCH5mNhyPp5z+1cYZnGMWgO0OQKsT6JizBMFhyW4gFSE5 ZfXmgN1gFtQKdj8lwV3EBZ2ZTYOddDarjRQM6zQ0ZAm9JEvgAuX9fj9G9aV6GPXj04qt N9X+1pdbY3sUKQKbj51NsLa/gwN6PxhMWkNRJTtL762Sy02Ez24NKwP+jM1SYsrYCWW3 F+sygX14hu4vFCzA4KeU8sPzhn760itfcEzQcWeHTzWR/Jph5ist7M+kDqjOlmCU5drk 9hnkuZKm1mi/eLZpg0+LGuceM0uZEPWnsnDNMdgUuXUhWaOAppSyWCndv67LP8vY19tU FU2w== X-Gm-Message-State: ALoCoQla6oL9poiVdZUhGlKVM8nPGh9FYkelmzZ/5w26OyM6dtHxkfqzpX5Quy0WDqG48yorw/Gf X-Received: by 10.152.2.233 with SMTP id 9mr756690lax.38.1380713689435; Wed, 02 Oct 2013 04:34:49 -0700 (PDT) Received: from condor-x220.synapse.com ([195.238.93.36]) by mx.google.com with ESMTPSA id i3sm1108577laf.4.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 02 Oct 2013 04:34:48 -0700 (PDT) From: Taras Kondratiuk To: Russell King Subject: [RFC PATCH] ARM: Flush L2 cache on soft_restart Date: Wed, 2 Oct 2013 14:34:16 +0300 Message-Id: <1380713656-24752-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-20131002_073514_830763_CD7B8F50 X-CRM114-Status: GOOD ( 12.44 ) X-Spam-Score: -2.6 (--) Cc: Taras Kondratiuk , Will Deacon , linux-arm-kernel@lists.infradead.org, Vijay Kilari 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 L2 cache before jumping to reboot code, but it doesn't flush it. So often just copied reboot code gets corrupted, because part of it is stored in L2 cache and have not reached memory. Flushing cache prevents this corruption. I'm facing this issue on Pandaboard ES, but it looks like similar issue is observed on TC2 board [1]. [1] http://www.spinics.net/lists/arm-kernel/msg264339.html Signed-off-by: Taras Kondratiuk --- arch/arm/kernel/process.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 94f6b05..e359b62 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c @@ -103,9 +103,11 @@ void soft_restart(unsigned long addr) local_irq_disable(); local_fiq_disable(); - /* Disable the L2 if we're the last man standing. */ - if (num_online_cpus() == 1) + /* Flush and disable the L2 if we're the last man standing. */ + if (num_online_cpus() == 1) { + outer_flush_all(); outer_disable(); + } /* Change to the new stack and continue with the reset. */ call_with_stack(__soft_restart, (void *)addr, (void *)stack);