Received: by 10.223.164.202 with SMTP id h10csp2912512wrb; Tue, 28 Nov 2017 03:26:21 -0800 (PST) X-Google-Smtp-Source: AGs4zMZ8q6myr8cXltiS9TXB2j6Ae+RxPA5Gin8bjoapekgIXANimyxmBDmLwwJjrEirz2App5XO X-Received: by 10.98.49.130 with SMTP id x124mr17906221pfx.149.1511868381269; Tue, 28 Nov 2017 03:26:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511868381; cv=none; d=google.com; s=arc-20160816; b=lvFNzNwB2xar3aatGjauuULo7HFENJArLQgdx+KmcviGEINWFBHJfEQdwnkx9alv3E kuO25EwH00yPUUCRgkRSaeX0dVvTWkJ+c6lCeOR/arVzSdebGzk9imnGNWsDPoc4CfRg O0yANwr6ndO7lDp928/MfwrFnsp2c2qRr2iAlPlSRUIXRd60Ina5tRyS8zj8M5N3msrD j6CygGKP0jd6MUruY311Es5LnJ4zAuuL9rvYqwYZZe49dhiLyM/QyJ3VKVbFGcexPRG6 KNZpdzrT5vfqbXqZSVynpyQVMV0pJjE02fL9uQETZtqMTL24RcG26AVVUw4SZSgg1HGD jTug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=ilDyYL/8OdO53gUDREjIGA/ZCLGffeXTDD9leHqMYpM=; b=kquT3hQmm3gJppcUbmo4gCm4/QkpLRR7eYFac1/zSEl86Hl5KElpBJeu4+zDTD8Ir3 viG8P+uNqBGYDMfbJ4GbaEX25QP1IhtdbeZW06M9udw8CoXzMs5TJf4QKjnrGVTLgPYG XbchLkkUzo2AAoC5Pdyc6ehQmuavB5nh7uBjvKc97wcCw08Fntv0hY+0GT/sP/FOI/aW yRhabFten8/2LlTV8y2ZxqX62e3KXTt0nlZZNAjCSOKvhLYX83DPuSTNwfsJzMEAG48m sXHYdLJmYHpipVsSZ6LNDTk9zsb316Kfhr4l9kO63wyhJIZdBKN85grVxQCHINDgJbRt 2ykg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@prevas.dk header.s=ironport1 header.b=puckiS8E; 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 3si25526772pli.476.2017.11.28.03.26.07; Tue, 28 Nov 2017 03:26:21 -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=fail header.i=@prevas.dk header.s=ironport1 header.b=puckiS8E; 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 S1755110AbdK1LYm (ORCPT + 78 others); Tue, 28 Nov 2017 06:24:42 -0500 Received: from mail01.prevas.se ([62.95.78.3]:21473 "EHLO mail01.prevas.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933126AbdK1Kp6 (ORCPT ); Tue, 28 Nov 2017 05:45:58 -0500 X-Greylist: delayed 597 seconds by postgrey-1.27 at vger.kernel.org; Tue, 28 Nov 2017 05:45:54 EST DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=prevas.dk; i=@prevas.dk; l=3248; q=dns/txt; s=ironport1; t=1511865958; x=1543401958; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=NxEaoIPPV5pMOfHU6wDov+OX+u3tmIP1P24FFIhf5Cw=; b=puckiS8EMWz6rpS6e9iy4TNctwI7xQ5b9DNLOjoUcb+u3R0tjwTfPBQa /Y/RslDjfgawBaoX9ANVnt4Ablsjjrkw0rFZNO99jBrH/Sdt7j5dEs1jI mzz9tHuoN+ATLZ5yXaUYHDfsgMSJ+BFSekNxdYJ2ME6mtXSbQcUQKThit M=; X-IronPort-AV: E=Sophos;i="5.44,467,1505772000"; d="scan'208";a="2879374" Received: from vmprevas4.prevas.se (HELO smtp.prevas.se) ([172.16.8.104]) by ironport1.prevas.se with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Nov 2017 11:35:58 +0100 Received: from prevas-ravi.prevas.se (172.16.8.31) by smtp.prevas.se (172.16.8.104) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 28 Nov 2017 11:35:58 +0100 From: Rasmus Villemoes To: Wim Van Sebroeck , Guenter Roeck , Jonathan Corbet CC: Esben Haabendal , , Rasmus Villemoes , , , Subject: [PATCH 2/2] watchdog: introduce CONFIG_WATCHDOG_OPEN_TIMEOUT Date: Tue, 28 Nov 2017 11:35:50 +0100 Message-ID: <1511865350-20665-3-git-send-email-rasmus.villemoes@prevas.dk> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511865350-20665-1-git-send-email-rasmus.villemoes@prevas.dk> References: <1511865350-20665-1-git-send-email-rasmus.villemoes@prevas.dk> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.16.8.31] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This allows setting a default value for the watchdog.open_timeout commandline parameter via Kconfig. Some BSPs allow remote updating of the kernel image and root file system, but updating the bootloader requires physical access. Hence, if one has a firmware update that requires relaxing the watchdog.open_timeout a little, the value used must be baked into the kernel image itself and cannot come from the u-boot environment via the kernel command line. Being able to set the initial value in .config doesn't change the fact that the value on the command line, if present, takes precedence, and is of course immensely useful for development purposes while one has console acccess, as well as usable in the cases where one can make a permanent update of the kernel command line. Signed-off-by: Rasmus Villemoes Reviewed-by: Esben Haabendal --- Documentation/watchdog/watchdog-parameters.txt | 3 ++- drivers/watchdog/Kconfig | 9 +++++++++ drivers/watchdog/watchdog_dev.c | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Documentation/watchdog/watchdog-parameters.txt b/Documentation/watchdog/watchdog-parameters.txt index 5363bf3..60dd2be 100644 --- a/Documentation/watchdog/watchdog-parameters.txt +++ b/Documentation/watchdog/watchdog-parameters.txt @@ -11,7 +11,8 @@ modules. The watchdog core parameter watchdog.open_timeout is the maximum time, in milliseconds, for which the watchdog framework will take care of pinging a hardware watchdog until userspace opens the corresponding -/dev/watchdogN device. A value of 0 (the default) means an infinite +/dev/watchdogN device. The defalt value is +CONFIG_WATCHDOG_OPEN_TIMEOUT. A value of 0 means an infinite timeout. Setting this to a non-zero value can be useful to ensure that either userspace comes up properly, or the board gets reset and allows fallback logic in the bootloader to try something else. diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index ca200d1..a142e1e 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -63,6 +63,15 @@ config WATCHDOG_SYSFS Say Y here if you want to enable watchdog device status read through sysfs attributes. +config WATCHDOG_OPEN_TIMEOUT + int "Timeout value for opening watchdog device" + default 0 + help + The maximum time, in milliseconds, for which the watchdog + framework takes care of pinging a hardware watchdog. A value + of 0 means infinite. The value set here can be overridden by + the commandline parameter "watchdog.open_timeout". + # # General Watchdog drivers # diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c index b4985db..9f18952 100644 --- a/drivers/watchdog/watchdog_dev.c +++ b/drivers/watchdog/watchdog_dev.c @@ -84,7 +84,7 @@ static struct workqueue_struct *watchdog_wq; static bool handle_boot_enabled = IS_ENABLED(CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED); -static unsigned open_timeout; +static unsigned open_timeout = CONFIG_WATCHDOG_OPEN_TIMEOUT; static bool watchdog_past_open_deadline(struct watchdog_core_data *data) { -- 2.7.4 From 1584411652675779046@xxx Sat Nov 18 13:44:59 +0000 2017 X-GM-THRID: 1584411652675779046 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread