Received: by 10.223.176.46 with SMTP id f43csp540909wra; Fri, 19 Jan 2018 23:34:08 -0800 (PST) X-Google-Smtp-Source: AH8x226geTE4m7PTPz5z04CECPlDd18YGbthJXw1Nxex0xFxWDOyF9EcTv2Jtr7gFKRqU2uUq8Kn X-Received: by 10.99.9.67 with SMTP id 64mr1167345pgj.257.1516433648201; Fri, 19 Jan 2018 23:34:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516433648; cv=none; d=google.com; s=arc-20160816; b=Tu1d8fobWB957Ph9y6dMCxVeDCSln+r6xoEh9mEMI3rfU/rUQ67tHJrCpZQgCmk7rG BWBTjyUZvJ62l5ltoQqkHaqzI4GaTIDoV5NgwcYUKwpb7igInWItPx1GCqDttjx4qmhY yXVPyMIcxY1j5RwoYBe/O4rsKCtNTeIEnV5nDvDdITo0ZYhFWuOeM6NzQ65gXhFEisO1 LN098LlQk3gOJekG/jW0ZiifSw5Zjoox70CEUh5s/iRnxRFQ7lRpqDAKoTCTNfkMe056 cGKoiNUsKQb/yfcxGh0lZByPHk28tLxpqHzdXBf/BpEtB5tnHALIGxGfGfFWzjOrTBzA 2Vzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=UmziYxfg7n7RhPSP4/jyO0Z9NfcQUXy0CWHVy2Hg90I=; b=F3LwlMlGfN7dTdjjVHvM3tIPdplmhodJGwThSjOaVOzracPX2YIuBqTvlBB2LL4xUO hhcKOY+ZJPhLU9xzltd9ZwtVC49bWg0sMUG1RC+gZQnIxKzwVemu56EiJ/28i0f+CRME 75zV4MiSIp1RQAasQBSiLYmSVxfHgRR3qUC8glIyH3frJueML/EE2ndwFUVSmcCoy0ai A8OruIK1dz6eX5oYeo2y88SC6TOFBj1ES8shV4nebDqAIV0l9et7+WxgRayjZeh3IL/0 R42fo+ST5qNR7enxbHmZrtt2Z2v4BdA4Yh70u9NtO8ItoBv5AsR06Cifw1XFXWB3gF5v RtLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YtMxZR58; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 127si9717295pgd.518.2018.01.19.23.33.40; Fri, 19 Jan 2018 23:34:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YtMxZR58; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751269AbeATHb1 (ORCPT + 99 others); Sat, 20 Jan 2018 02:31:27 -0500 Received: from mail-io0-f196.google.com ([209.85.223.196]:43805 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750993AbeATHbT (ORCPT ); Sat, 20 Jan 2018 02:31:19 -0500 Received: by mail-io0-f196.google.com with SMTP id 72so4480835iom.10; Fri, 19 Jan 2018 23:31:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=UmziYxfg7n7RhPSP4/jyO0Z9NfcQUXy0CWHVy2Hg90I=; b=YtMxZR58qA+8SuXkIHfKS5qriOgr23+rOxtvR/ZtOoYRIo4pmyEWSMW5XRGJVGDxg2 CvYCimN9vu6Y/+c5sQTT7aUYa1lGulnmXYxwTXZanzUxGmiMzhqFXBqt2cysu3q7KyKI yfusJRnCaSFxXLSwviGNPTrOpC72pNCmDQMWQwHUZtuyPxYKNCWeN5rejzUpx8IC8jZX BRF2MDK8lZ9mt1H+aQlzJe5fJmqHMtt26g2rHJyC3TVUqfP4utUPWTFFsGbTnH79jEpQ X9MRpT9VXY7Rl25QfGrTsbq+16pVDjHVPT07ND19btP4Aw/QHZTZNFINDBOkcyxG1jFX eQaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=UmziYxfg7n7RhPSP4/jyO0Z9NfcQUXy0CWHVy2Hg90I=; b=YEXaM8ruk6XqLuLN5/TfiP8KmyrXrnX2rFqLjo6jOD40ZQKVR3pho26kUxdjDoVBLd WH8VyJbW/R/sDOycplH0G/AmLRThY5BTcb/Sp3oIKKgYX25wrQF/3eOmTADeyIWpB0Z8 y+8X1Y1yVLhCr0btPFKhwTd64UZRalJ2eVR34kYLoUKYe3AsGI2ShceEkQXjEegBP1Zn v/zuVm+f1upVapRGZwjWLxnssBAgIXzawAFgGCFPJMXAMdr7+K7NQ155PIFO8dXRJqq0 JrMOTIKbZ5xva2y09huLIMkOy/zQprMvSTbDwUIcSWtSbH2Oivsow2Cj/K9hp/62LL2H r78A== X-Gm-Message-State: AKwxytd49pGYO6gb8+K70YozSGQ9yR0UgG0XfuAJipmeiLCyyGt+HRmA Ua0GZf4DXjWx53l2xJLJ6faHtAEC4T7I5gzkeMw= X-Received: by 10.107.158.211 with SMTP id h202mr1025986ioe.129.1516433478539; Fri, 19 Jan 2018 23:31:18 -0800 (PST) MIME-Version: 1.0 Received: by 10.2.165.9 with HTTP; Fri, 19 Jan 2018 23:31:17 -0800 (PST) In-Reply-To: <20171230135108.6834-3-paul@crapouillou.net> References: <20171228162939.3928-2-paul@crapouillou.net> <20171230135108.6834-1-paul@crapouillou.net> <20171230135108.6834-3-paul@crapouillou.net> From: PrasannaKumar Muralidharan Date: Sat, 20 Jan 2018 13:01:17 +0530 Message-ID: Subject: Re: [PATCH v2 3/8] watchdog: JZ4740: Register a restart handler To: Paul Cercueil Cc: Ralf Baechle , Rob Herring , Mark Rutland , Wim Van Sebroeck , Guenter Roeck , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux-MIPS , open list , linux-watchdog@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Paul, On 30 December 2017 at 19:21, Paul Cercueil wrote: > The watchdog driver can restart the system by simply configuring the > hardware for a timeout of 0 seconds. > > Signed-off-by: Paul Cercueil > Reviewed-by: Guenter Roeck > --- > drivers/watchdog/jz4740_wdt.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > v2: No change > > diff --git a/drivers/watchdog/jz4740_wdt.c b/drivers/watchdog/jz4740_wdt.c > index 92d6ca8ceb49..fa7f49a3212c 100644 > --- a/drivers/watchdog/jz4740_wdt.c > +++ b/drivers/watchdog/jz4740_wdt.c > @@ -130,6 +130,14 @@ static int jz4740_wdt_stop(struct watchdog_device *wdt_dev) > return 0; > } > > +static int jz4740_wdt_restart(struct watchdog_device *wdt_dev, > + unsigned long action, void *data) > +{ > + wdt_dev->timeout = 0; > + jz4740_wdt_start(wdt_dev); > + return 0; > +} > + > static const struct watchdog_info jz4740_wdt_info = { > .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE, > .identity = "jz4740 Watchdog", > @@ -141,6 +149,7 @@ static const struct watchdog_ops jz4740_wdt_ops = { > .stop = jz4740_wdt_stop, > .ping = jz4740_wdt_ping, > .set_timeout = jz4740_wdt_set_timeout, > + .restart = jz4740_wdt_restart, > }; > > #ifdef CONFIG_OF > -- > 2.11.0 > > Noticed that min_timeout of the watchdog device is set to 1 but this function calls start with timeout set to 0. Even though this works I feel it is better to set min_timeout to 0. Regards, PrasannaKumar