Received: by 10.192.165.148 with SMTP id m20csp1507962imm; Thu, 10 May 2018 11:49:00 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpd8wsh7AdmdLIscQ/KyFSlf0gJ066adW6oCrV4pTTbLSq5Mas7ciq/rMoSWxYh/VdeMu+k X-Received: by 2002:a17:902:264:: with SMTP id 91-v6mr2366529plc.341.1525978140143; Thu, 10 May 2018 11:49:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525978140; cv=none; d=google.com; s=arc-20160816; b=QHIjWWl0Znr4nvVAbESn1NgIIaWOeuvhtAGi+OrEap2vqbpzckmHdbG8Yr/ual/bSw 9F6HzBqNoKKR64tw3d6r21MAA+O+2nWUsn9X/U+UK8+4v1UTt47NnezG6lPU6vzCV5BD hqOyQlsrbHrBh/l0VMcCbnfMiumJLHnRVhiUxT0eySg0wHBRqD+egg0MXNXwZAMLai/p ShlBKvqWjKGbq+iaD0SRLbO7XqpsTQoS3Inhz5V4Ded53DgpN3RbyojQ4FLT4niX5sFn 4AndKvCM1Gx615tMxxA7c7TLLjc6AR/a9mRmDnSojlFqNN8czXxn5C8knMX2Ez6FylP4 7NTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=OtHFyNCHq0eEAmreGoWW56gceeLqBbC1Qg/8cFaUgRQ=; b=NMjWbb9CFQIAXOdAW/cVJKTMkQGvfma0h5pkYdbZ5/QIYwJO4cL4KDRulc/IPHXCRs 2yt0EElwx3ywfzO+ibARhYAx9sxQQSr5PmIounBMZNOsci4NHN0Jo6fj3ssSRv8C2qGe l0dnjZRqTP6wzsIAUg288IbnPexQFFXtRqHdMnsKlGk7vS5FPYoewv/R9Vhv3BiZW6D/ M305b3IPvHk9pOymKA/9vhKT4xJyPfWv4Kge10YTVz+R2esXRCFxXYxIalWJRtjNXIdf YywYns/4W9SzJjCNAaYKStnoH7mnv5PofH0rDma1ElkeNCOHeXRvkq7pxsmtQeHJDd0F wAJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=xa+rWlCi; 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=crapouillou.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k70-v6si1036461pgc.493.2018.05.10.11.48.45; Thu, 10 May 2018 11:49:00 -0700 (PDT) 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=@crapouillou.net header.s=mail header.b=xa+rWlCi; 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=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751953AbeEJSs2 (ORCPT + 99 others); Thu, 10 May 2018 14:48:28 -0400 Received: from outils.crapouillou.net ([89.234.176.41]:55632 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750972AbeEJSsW (ORCPT ); Thu, 10 May 2018 14:48:22 -0400 From: Paul Cercueil To: Guenter Roeck , Rob Herring , Mark Rutland , Ralf Baechle , James Hogan Cc: Wim Van Sebroeck , Mathieu Malaterre , linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@linux-mips.org, Paul Cercueil Subject: [PATCH v3 3/8] watchdog: JZ4740: Register a restart handler Date: Thu, 10 May 2018 20:47:46 +0200 Message-Id: <20180510184751.13416-3-paul@crapouillou.net> In-Reply-To: <20180510184751.13416-1-paul@crapouillou.net> References: <20180510184751.13416-1-paul@crapouillou.net> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1525978100; bh=OtHFyNCHq0eEAmreGoWW56gceeLqBbC1Qg/8cFaUgRQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=xa+rWlCibr0gzOrxxjm2KNyccEC/agnSz19HPY7yc4aqnADiDtcOYdFtY2r3Zm2a54/fvm3slU6v5RpPBuFUXb3lYAXZ1Q4p589iRhC2B6OMER7ts6rOI1z7IFyLvrcMFDczfZNDtu0b6GgFVJAVDy8JxcVLDZ5xmN22BajCiIY= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 v3: No change diff --git a/drivers/watchdog/jz4740_wdt.c b/drivers/watchdog/jz4740_wdt.c index 22136e3522b9..b8b015a7d045 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