From patchwork Wed Aug 8 10:18:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 1294341 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id A23A63FC23 for ; Wed, 8 Aug 2012 10:21:09 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Sz3L1-0008Ea-Ec; Wed, 08 Aug 2012 10:18:03 +0000 Received: from co1ehsobe003.messaging.microsoft.com ([216.32.180.186] helo=co1outboundpool.messaging.microsoft.com) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Sz3Kx-0008EL-LE for linux-arm-kernel@lists.infradead.org; Wed, 08 Aug 2012 10:18:00 +0000 Received: from mail57-co1-R.bigfish.com (10.243.78.230) by CO1EHSOBE011.bigfish.com (10.243.66.74) with Microsoft SMTP Server id 14.1.225.23; Wed, 8 Aug 2012 10:17:56 +0000 Received: from mail57-co1 (localhost [127.0.0.1]) by mail57-co1-R.bigfish.com (Postfix) with ESMTP id BAA18380062; Wed, 8 Aug 2012 10:17:56 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 3 X-BigFish: VS3(zcb8kzzz1202hzzz2dh87h2a8h668h839h944hd25he96hf0ah107ah) X-FB-DOMAIN-IP-MATCH: fail Received: from mail57-co1 (localhost.localdomain [127.0.0.1]) by mail57-co1 (MessageSwitch) id 1344421074729295_29988; Wed, 8 Aug 2012 10:17:54 +0000 (UTC) Received: from CO1EHSMHS007.bigfish.com (unknown [10.243.78.239]) by mail57-co1.bigfish.com (Postfix) with ESMTP id AEF6DC80019; Wed, 8 Aug 2012 10:17:54 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CO1EHSMHS007.bigfish.com (10.243.66.17) with Microsoft SMTP Server (TLS) id 14.1.225.23; Wed, 8 Aug 2012 10:17:53 +0000 Received: from az84smr01.freescale.net (10.64.34.197) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server (TLS) id 14.2.298.5; Wed, 8 Aug 2012 05:17:52 -0500 Received: from S2101-09.ap.freescale.net ([10.192.185.201]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id q78AHkEs024176; Wed, 8 Aug 2012 03:17:47 -0700 Date: Wed, 8 Aug 2012 18:18:20 +0800 From: Shawn Guo To: Subject: imx6q restart is broken Message-ID: <20120808101817.GA14718@S2101-09.ap.freescale.net> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-OriginatorOrg: sigmatel.com 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 [216.32.180.186 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Dirk Behme , Russell King - ARM Linux 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 Thanks Dirk for reporting that imx6q restart (reboot command) is broken. I tracked down the issue a little bit and found imx6q_restart hangs on the of_iomap/ioremap call. The following change, moving the call somewhere else than imx6q_restart, will just fix the problem. Does that mean ioremap call is not allowed in platform restart hook? I'm not sure about that, because I found it works just fine if I build imx_v6_v7_defconfig with V6 (imx3) platforms excluded (IOW, build a V7 only kernel - imx5 and imx6), which is the case how I tested imx6q restart feature when I was adding it. To summarize, the imx6q_restart hangs at ioremap call on a V6 + V7 kernel, while it works fine on a V7 only image. I need some help to understand that. Regards, Shawn --8<--- diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index 5ec0608..01e7489 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c @@ -37,14 +37,10 @@ #include #include +static void __iomem *wdog_base; void imx6q_restart(char mode, const char *cmd) { - struct device_node *np; - void __iomem *wdog_base; - - np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-wdt"); - wdog_base = of_iomap(np, 0); if (!wdog_base) goto soft; @@ -159,6 +155,11 @@ static void __init imx6q_usb_init(void) static void __init imx6q_init_machine(void) { + struct device_node *np; + + np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-wdt"); + wdog_base = of_iomap(np, 0); + /* * This should be removed when all imx6q boards have pinctrl * states for devices defined in device tree.