From patchwork Wed Feb 6 04:00:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kumar, Anil" X-Patchwork-Id: 2101531 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 0B3663FDF1 for ; Wed, 6 Feb 2013 04:03:02 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U2wAs-0005V6-DL; Wed, 06 Feb 2013 03:59:54 +0000 Received: from bear.ext.ti.com ([192.94.94.41]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1U2wAi-0005T8-Ar for linux-arm-kernel@lists.infradead.org; Wed, 06 Feb 2013 03:59:46 +0000 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id r163xXj3025271; Tue, 5 Feb 2013 21:59:33 -0600 Received: from DBDE71.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id r163xVNX006810; Wed, 6 Feb 2013 09:29:31 +0530 (IST) Received: from dbdp32.itg.ti.com (172.24.170.251) by DBDE71.ent.ti.com (172.24.170.149) with Microsoft SMTP Server id 14.1.323.3; Wed, 6 Feb 2013 09:29:30 +0530 Received: from ucmsshproxy.india.ext.ti.com (dbdp20.itg.ti.com [172.24.170.38]) by dbdp32.itg.ti.com (8.13.8/8.13.8) with SMTP id r163xUbt016397; Wed, 6 Feb 2013 09:29:30 +0530 Received: from symphony.india.ext.ti.com (unknown [192.168.247.13]) by ucmsshproxy.india.ext.ti.com (Postfix) with ESMTP id 38CE8158002; Wed, 6 Feb 2013 09:29:30 +0530 (IST) Received: from ubuntu-psp-linux.india.ext.ti.com (ubuntu-psp-linux [192.168.247.46]) by symphony.india.ext.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id r163xTR07339; Wed, 6 Feb 2013 09:29:29 +0530 (IST) From: "Kumar, Anil" To: , , , Subject: [PATCH V2 2/2] ARM: davinci: restart: fix wdt to machine restart with DT Date: Wed, 6 Feb 2013 09:30:04 +0530 Message-ID: <1360123204-9978-3-git-send-email-anilkumar.v@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1360123204-9978-1-git-send-email-anilkumar.v@ti.com> References: <1360123204-9978-1-git-send-email-anilkumar.v@ti.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130205_225944_480382_E5FFBBE2 X-CRM114-Status: GOOD ( 15.30 ) X-Spam-Score: -7.6 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [192.94.94.41 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: mporter@ti.com, linux@arm.linux.org.uk, mchehab@redhat.com, khilman@deeprootsystems.com, broonie@opensource.wolfsonmicro.com, nsekhar@ti.com, vaibhav.bedia@ti.com, grant.likely@secretlab.ca, tony@atomide.com, rob.herring@calxeda.com, anilkumar.v@ti.com, hs@denx.de, b-cousson@ti.com 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 In non DT case da8xx_register_watchdog() is called to register platform device "da8xx_wdt_device" by board file. But in DT case it is not called and wdt device get registered via wdt DT node. Currently code is passing platform device "da8xx_wdt_device" in "davinci_watchdog_reset" function in both DT and non DT case and that leads to crash in DT boot. Update restart function to make it generic DaVinci machine restart in case of DT and non DT boot. Signed-off-by: Kumar, Anil --- :100644 100644 2d5502d... 1df68fd... M arch/arm/mach-davinci/devices-da8xx.c :100644 100644 700d311... ef9f70e... M arch/arm/mach-davinci/include/mach/da8xx.h arch/arm/mach-davinci/devices-da8xx.c | 14 ++++++++++++-- arch/arm/mach-davinci/include/mach/da8xx.h | 1 - 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c index 2d5502d..1df68fd 100644 --- a/arch/arm/mach-davinci/devices-da8xx.c +++ b/arch/arm/mach-davinci/devices-da8xx.c @@ -359,7 +359,7 @@ static struct resource da8xx_watchdog_resources[] = { }, }; -struct platform_device da8xx_wdt_device = { +static struct platform_device da8xx_wdt_device = { .name = "watchdog", .id = -1, .num_resources = ARRAY_SIZE(da8xx_watchdog_resources), @@ -368,7 +368,17 @@ struct platform_device da8xx_wdt_device = { void da8xx_restart(char mode, const char *cmd) { - davinci_watchdog_reset(&da8xx_wdt_device); + struct device *dev = NULL; + struct platform_device *wdt_device = NULL; + + dev = bus_find_device_by_name(&platform_bus_type, NULL, "watchdog"); + if (!dev) { + pr_err("wdt device not found to machine reboot\n"); + return; + } + + wdt_device = to_platform_device(dev); + davinci_watchdog_reset(wdt_device); } int __init da8xx_register_watchdog(void) diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h index 700d311..ef9f70e 100644 --- a/arch/arm/mach-davinci/include/mach/da8xx.h +++ b/arch/arm/mach-davinci/include/mach/da8xx.h @@ -112,7 +112,6 @@ extern struct da8xx_lcdc_platform_data sharp_lcd035q3dg01_pdata; extern struct da8xx_lcdc_platform_data sharp_lk043t1dg01_pdata; extern struct davinci_spi_platform_data da8xx_spi_pdata[]; -extern struct platform_device da8xx_wdt_device; extern const short da830_emif25_pins[]; extern const short da830_spi0_pins[];