Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp388817ybl; Tue, 7 Jan 2020 07:52:47 -0800 (PST) X-Google-Smtp-Source: APXvYqw1maHT6AnfTeBnwN7ViKL3KpoMmF4G7hpREV4rI1+9WiBxLnyZdNGfhbmNRG2nhzcZBMvX X-Received: by 2002:a9d:7448:: with SMTP id p8mr421435otk.96.1578412367579; Tue, 07 Jan 2020 07:52:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578412367; cv=none; d=google.com; s=arc-20160816; b=h3T+vcl/wrxjGUIptjbKkfoPR/pZGzA7VEUvb4wjH63GcKUTkoo+8aMacBL8fOujFV R8TGpNP5mj/U4+Dnw1qnP/XssyY2ibBYtEF9x4DuUrelD98RUySRG3H/h1eT23TAff21 pkFKsXPB6L+7lftefDv3E2mjwPlj1RYIBB9qVroZv6mexlA0GDgeGtdqt9MSGCT9OQYn Dwz7kSrfBG78vnf9RmKrOcshRrwYPxsOmY+KytbswXE6PHk4DrMDcwUtOaJeVzGSPbWn P1UBBkg1qepOAfI1ZUg/9R4FA0pAG9L/siIOsU7VbMrISAhNwYp97ZF2QrO6Bech52Yw pmYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from; bh=dLhP5qOJAJLK+XGrPTb4T7SHFCjagRUu55lgxvam/30=; b=cZXRvOjdsuJuJ+qGlGFdXGiuCCBy6GJkCayEgAxOswRVnoej+vCxA9Lk5nU8sHaLNj qutoADy/lFFpnk+5FC2mowMn8H4DAHlYu6NAEM0ClinCej70wij7+6ZmETg+O/oklqdV xANUsXfbITybp33a8A4FSrQ0m0vz2e7cgVv+yF/E3tqVsDKkPY4ehDChIR38FV5q0gTH ptsG6i1N565sJ/EOngWQhMjMlWquNtprZ0/d0mGNMVYHmNlpxjyCl4L+qWbm0cHqC/YT A3hmCtGqugfVbU0D/vnJJSWvhvYclqORw5Ekns3CmtKoYHMNXNQNgGraCeVLK6h+H+eN Sgqw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l26si51454oti.152.2020.01.07.07.52.35; Tue, 07 Jan 2020 07:52:47 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728448AbgAGPvd (ORCPT + 99 others); Tue, 7 Jan 2020 10:51:33 -0500 Received: from unsecure-smtp.soverin.net ([94.130.159.241]:45154 "EHLO g02sm02.soverin.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727994AbgAGPvc (ORCPT ); Tue, 7 Jan 2020 10:51:32 -0500 Received: from soverin.net by soverin.net From: Jack Mitchell Cc: ml@embed.me.uk, Wim Van Sebroeck , Guenter Roeck , linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] watchdog: dw_wdt: ping watchdog to reset countdown before start Date: Tue, 7 Jan 2020 15:43:54 +0000 Message-Id: <20200107154354.277648-1-ml@embed.me.uk> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.99.2 at g02sm02 X-Virus-Status: Clean Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently on an rk3288 SoC when trying to use the watchdog the SoC will instantly reset. This is due to the watchdog countdown counter being set to its initial value of 0x0. Reset the watchdog counter before start in order to correctly start the countdown timer from the right position. Signed-off-by: Jack Mitchell --- drivers/watchdog/dw_wdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c index fef7c61f5555..cf59204556f9 100644 --- a/drivers/watchdog/dw_wdt.c +++ b/drivers/watchdog/dw_wdt.c @@ -135,6 +135,7 @@ static int dw_wdt_start(struct watchdog_device *wdd) struct dw_wdt *dw_wdt = to_dw_wdt(wdd); dw_wdt_set_timeout(wdd, wdd->timeout); + dw_wdt_ping(&dw_wdt->wdd); dw_wdt_arm_system_reset(dw_wdt); return 0; @@ -257,7 +258,6 @@ static int dw_wdt_drv_probe(struct platform_device *pdev) ret = -EINVAL; goto out_disable_clk; } - dw_wdt->rst = devm_reset_control_get_optional_shared(&pdev->dev, NULL); if (IS_ERR(dw_wdt->rst)) { ret = PTR_ERR(dw_wdt->rst); -- 2.24.1