From patchwork Tue Dec 10 04:39:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Yanovich X-Patchwork-Id: 3314161 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 602C09F37A for ; Tue, 10 Dec 2013 04:40:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 76BE820279 for ; Tue, 10 Dec 2013 04:40:08 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 934D520272 for ; Tue, 10 Dec 2013 04:40:07 +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 1VqF6z-0007wb-IJ; Tue, 10 Dec 2013 04:39:57 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VqF6x-0003KN-7I; Tue, 10 Dec 2013 04:39:55 +0000 Received: from mail-la0-x229.google.com ([2a00:1450:4010:c03::229]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VqF6t-0003Jl-MC for linux-arm-kernel@lists.infradead.org; Tue, 10 Dec 2013 04:39:52 +0000 Received: by mail-la0-f41.google.com with SMTP id eo20so2268850lab.14 for ; Mon, 09 Dec 2013 20:39:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=39PzWMs/Q0ap8STOSw1LOXU5jjqR418STwOtoLSlz8Q=; b=SW57bbHyWUae9ihfsQSy6K0ohJnHm6nRMZo9H/68C+JtNgJ/KD8v2ca0Vd76lEY1JB zz7hWYk8KXobr8l+cT2hf6Jb8xL9hArctH3BVVhK93iGixP4vAksjzah5jdCrKZxsU6G ttLtAwdAHnyhTc90HtwOdHovc4CSs4ksgPepWwT8ZE/FoXxq/XWxKY1qy4zY3forAh0H sa2XRciZ0T4g246QQpbd9U434iKqZ+rZP3NzvTBqFqf9WUmoSCVe5IUcyUgE9P4LISRx tU1jgzXyWRocy62P0D5wwJ5KBJBgpNNidAcAfjmahMsohx0yrVIIqB4mEieYEX073Nvb dq3g== X-Received: by 10.152.87.13 with SMTP id t13mr3039622laz.72.1386650368467; Mon, 09 Dec 2013 20:39:28 -0800 (PST) Received: from host5.omatika.ru (0893675324.static.corbina.ru. [95.31.1.192]) by mx.google.com with ESMTPSA id sd11sm19009830lab.2.2013.12.09.20.39.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Dec 2013 20:39:27 -0800 (PST) From: Sergei Ianovich To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: pxa: prevent PXA270 occasional reboot freezes Date: Tue, 10 Dec 2013 08:39:15 +0400 Message-Id: <1386650355-2503-1-git-send-email-ynvich@gmail.com> X-Mailer: git-send-email 1.8.4.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131209_233951_922018_177CBE10 X-CRM114-Status: GOOD ( 10.67 ) X-Spam-Score: -1.9 (-) Cc: Sergei Ianovich , Russell King , Eric Miao , Haojian Zhuang 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.0 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RCVD_IN_SBL, RP_MATCHES_RCVD, T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=no 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 Erratum 71 of PXA270M Processor Family Specification Update (April 19, 2010) explains that watchdog reset time is just 8us insead of 10ms in EMTS. If SDRAM is not reset, it causes memory bus congestion and the device hangs. We put SDRAM in selfresh mode before watchdog reset, removing potential freezes. Without this patch PXA270-based ICP DAS LP-8x4x hangs after up to 40 reboots. With this patch it has successfully rebooted 500 times. Signed-off-by: Sergei Ianovich Tested-by: Marek Vasut --- arch/arm/mach-pxa/reset.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-pxa/reset.c b/arch/arm/mach-pxa/reset.c index 0d5dd64..263b152 100644 --- a/arch/arm/mach-pxa/reset.c +++ b/arch/arm/mach-pxa/reset.c @@ -13,6 +13,7 @@ #include #include +#include unsigned int reset_status; EXPORT_SYMBOL(reset_status); @@ -81,6 +82,12 @@ static void do_hw_reset(void) writel_relaxed(OSSR_M3, OSSR); /* ... in 100 ms */ writel_relaxed(readl_relaxed(OSCR) + 368640, OSMR3); + /* + * SDRAM hangs on watchdog reset on Marvell PXA270 (erratum 71) + * we put SDRAM into self-refresh to prevent that + */ + while (1) + writel_relaxed(MDREFR_SLFRSH, MDREFR); } void pxa_restart(enum reboot_mode mode, const char *cmd) @@ -104,4 +111,3 @@ void pxa_restart(enum reboot_mode mode, const char *cmd) break; } } -