From patchwork Thu Oct 8 21:34:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sylvain Rochet X-Patchwork-Id: 7355441 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 04F82BEEA4 for ; Thu, 8 Oct 2015 21:37:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1C2002078B for ; Thu, 8 Oct 2015 21:37:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 384482051F for ; Thu, 8 Oct 2015 21:37:27 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZkIr8-0000C5-6l; Thu, 08 Oct 2015 21:36:06 +0000 Received: from mx-guillaumet.finsecur.com ([91.217.234.131] helo=guillaumet.finsecur.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZkIqB-0006pn-72 for linux-arm-kernel@lists.infradead.org; Thu, 08 Oct 2015 21:35:09 +0000 Received: from [172.16.8.13] (helo=spice.lan) by guillaumet.finsecur.com with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1ZkIpk-0005RQ-Gv; Thu, 08 Oct 2015 23:34:42 +0200 Received: from gradator by spice.lan with local (Exim 4.86) (envelope-from ) id 1ZkIpk-000470-Bn; Thu, 08 Oct 2015 23:34:40 +0200 From: Sylvain Rochet To: Guenter Roeck , Boris BREZILLON , linux-kernel@vger.kernel.org, Nicolas Ferre , Ludovic Desroches , linux-arm-kernel@lists.infradead.org, Alexandre Belloni , Wenyou Yang , Wim Van Sebroeck Date: Thu, 8 Oct 2015 23:34:31 +0200 Message-Id: <1444340074-15437-4-git-send-email-sylvain.rochet@finsecur.com> X-Mailer: git-send-email 2.5.1 In-Reply-To: <1444340074-15437-1-git-send-email-sylvain.rochet@finsecur.com> References: <1444340074-15437-1-git-send-email-sylvain.rochet@finsecur.com> X-SA-Exim-Connect-IP: 172.16.8.13 X-SA-Exim-Mail-From: sylvain.rochet@finsecur.com X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Subject: [PATCH 3/6] watchdog: at91sam9: rename heartbeats into timeout where necessary X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on guillaumet.finsecur.com) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151008_143507_532462_C85D5135 X-CRM114-Status: GOOD ( 12.85 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sylvain Rochet MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP There is a confusing naming here, heartbeats is used instead of timeout where the real meaning is timeout in various places. Remove the unused WDT_TIMEOUT variable, which used to be a heartbeat value. Rename WDT_HEARTBEAT into WDT_DEFAULT_TIMEOUT and rename "heartbeats" into "timeout" in pr_ strings where necessary. Rename the "enabled" in the watchdog welcome message ("enabled (timeout = %d sec, nowayout = %d)\n") to "initialized", the watchdog user land timeout and nowayout values are not used before userland starts to pat the watchdog, reduce confusion by not telling those values are used right now while there are not. Signed-off-by: Sylvain Rochet --- drivers/watchdog/at91sam9_wdt.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/watchdog/at91sam9_wdt.c b/drivers/watchdog/at91sam9_wdt.c index 8c1c9de..2c506e0 100644 --- a/drivers/watchdog/at91sam9_wdt.c +++ b/drivers/watchdog/at91sam9_wdt.c @@ -65,15 +65,13 @@ /* Hardware timeout in seconds */ #define WDT_HW_TIMEOUT 16 -/* Timer heartbeat (500ms) */ -#define WDT_TIMEOUT (HZ/2) +/* User land default timeout */ +#define WDT_DEFAULT_TIMEOUT 15 -/* User land timeout */ -#define WDT_HEARTBEAT 15 -static int heartbeat; -module_param(heartbeat, int, 0); -MODULE_PARM_DESC(heartbeat, "Watchdog heartbeats in seconds. " - "(default = " __MODULE_STRING(WDT_HEARTBEAT) ")"); +static int wdt_timeout = WDT_DEFAULT_TIMEOUT; +module_param(wdt_timeout, int, 0); +MODULE_PARM_DESC(wdt_timeout, "Watchdog timeout in seconds. " + "(default = " __MODULE_STRING(WDT_DEFAULT_TIMEOUT) ")"); static bool nowayout = WATCHDOG_NOWAYOUT; module_param(nowayout, bool, 0); @@ -234,7 +232,7 @@ static int at91_wdt_init(struct platform_device *pdev, struct at91wdt *wdt) /* Try to set timeout from device tree first */ if (watchdog_init_timeout(&wdt->wdd, 0, dev)) - watchdog_init_timeout(&wdt->wdd, heartbeat, dev); + watchdog_init_timeout(&wdt->wdd, wdt_timeout, dev); watchdog_set_nowayout(&wdt->wdd, wdt->nowayout); err = watchdog_register_device(&wdt->wdd); if (err) @@ -344,7 +342,7 @@ static int __init at91wdt_probe(struct platform_device *pdev) wdt->wdd.parent = &pdev->dev; wdt->wdd.info = &at91_wdt_info; wdt->wdd.ops = &at91_wdt_ops; - wdt->wdd.timeout = WDT_HEARTBEAT; + wdt->wdd.timeout = wdt_timeout; wdt->wdd.min_timeout = 1; wdt->wdd.max_timeout = 0xFFFF; @@ -377,7 +375,7 @@ static int __init at91wdt_probe(struct platform_device *pdev) platform_set_drvdata(pdev, wdt); - pr_info("enabled (heartbeat=%d sec, nowayout=%d)\n", + pr_info("initialized (timeout=%d sec, nowayout=%d)\n", wdt->wdd.timeout, wdt->nowayout); return 0;