Received: by 10.223.164.202 with SMTP id h10csp2912302wrb; Tue, 28 Nov 2017 03:26:07 -0800 (PST) X-Google-Smtp-Source: AGs4zMbKaeYCrkz9wQYJyj5dpmonPYR4uWHzBBrga8os5cmmI8dBeo1g/jG73o45QtpycdNsloQn X-Received: by 10.98.194.71 with SMTP id l68mr23061192pfg.221.1511868367074; Tue, 28 Nov 2017 03:26:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511868367; cv=none; d=google.com; s=arc-20160816; b=LixaLE/vOZAm/FpdJfoGnSMOHI4As8rVBACiwZP0G7FIjZeSHnVBt4ramr7qYlHuC+ zBylZcp94p4OsGkED3xu6VQWEn1z/MuIfZZzujNWC8fccyfA+2NdnXHX8cQXpkFh77HS 9i1sZyC+Z2dBPmlpX/P+T4utma6We0UHxOCn7VlpFFHbCpc7TPU7BbG1JwVS2PegoqF8 ZfnQU1p74/yZtcDB8KK4gyWYhA/o+Fi70KQMKmZKSPA8EEVjPKcuViobhCDVJeMJUqvY 78K4H/n/4fxrfTjqOAUOw7gowdqOZ13d5N1K8GroheCUUZogJ4rlMykOnLFeW5tzhrCt dP8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature:arc-authentication-results; bh=tWfEKSJj+TvpDX/b+YhR1Zj1LO1JoPvSjqwTXBDdM5Q=; b=CPPh5wYgcCBBYQ0Tmla9kGGSfZxNH3tOCcWTOllk4qg8pBahtMnIXsCLOJL+dWRIyx i/dKqVY6S9+Yn9h4hphHFO+qPFOs3Gjz9qvzfk2BEQ2AZYiYx6iZrBxIJYyZDAmOlTdI hD1ztAQon8O+gfBLzuDHDxXLKTr3bhGlJ1aqprCmNft+TCUG4BmpIXk5ftwrV2XBHxG7 CRTJEX1wQfvwG3iNqzpNtdVflaBylAkjNu+NFGId/DOtWT9mWRwceaYV+y65XtdR6cl3 zZ5C/6Ggl1sRwvDu73nPp8sFJrK/eMtPQtUp6oaUpS99x0NNrw5AJVLBhvY0SgJh9AsE gJrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@prevas.dk header.s=ironport1 header.b=G2VRzAqG; 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 q2si66212pgf.448.2017.11.28.03.25.55; Tue, 28 Nov 2017 03:26:07 -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=G2VRzAqG; 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 S933141AbdK1KqB (ORCPT + 79 others); Tue, 28 Nov 2017 05:46:01 -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 S932809AbdK1Kpz (ORCPT ); Tue, 28 Nov 2017 05:45:55 -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=2616; q=dns/txt; s=ironport1; t=1511865955; x=1543401955; h=from:to:cc:subject:date:message-id:mime-version; bh=Mhe7ZMxYL5oftpZJtRJons0eH1Nzl0N3s72ZzkN8T9g=; b=G2VRzAqGNVbDgWygZt3DHFf4tDQqx9B8G/r+z56dgfZu6lBP04l//0Iv Rnb+eub9KX28vRXlS7eM9n0RJ5ZQ7OKjG19a1XgVMAHKx5dKeiaGhtD5j qAikaTt4jeAtFHWB/j9aZXTE8LBOWxFpneYBp+gjC871QV5XQfPQ90cFW s=; X-IronPort-AV: E=Sophos;i="5.44,467,1505772000"; d="scan'208";a="2879373" 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:56 +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:56 +0100 From: Rasmus Villemoes To: , , CC: Wim Van Sebroeck , Esben Haabendal , , Rasmus Villemoes , Guenter Roeck Subject: [PATCH v7 0/2] watchdog: allow setting deadline for opening /dev/watchdogN Date: Tue, 28 Nov 2017 11:35:48 +0100 Message-ID: <1511865350-20665-1-git-send-email-rasmus.villemoes@prevas.dk> X-Mailer: git-send-email 2.7.4 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 If a watchdog driver tells the framework that the device is running, the framework takes care of feeding the watchdog until userspace opens the device. If the userspace application which is supposed to do that never comes up properly, the watchdog is fed indefinitely by the kernel. This can be especially problematic for embedded devices. The existing handle_boot_enabled cmdline parameter/config option partially solves that, but that is only usable for the subset of hardware watchdogs that have (or can be configured by the bootloader to have) a timeout that is sufficient to make it realistic for userspace to come up. Many devices have timeouts of a second, or even less, making handle_boot_enabled insufficient. These patches allow one to set a maximum time for which the kernel will feed the watchdog, thus ensuring that either userspace has come up, or the board gets reset. This allows fallback logic in the bootloader to attempt some recovery (for example, if an automatic update is in progress, it could roll back to the previous version). The patches have been tested on a Raspberry Pi 2 and a Wandboard. A preparatory patch of this series has already been merged (c013b65ad8a1e "watchdog: introduce watchdog_worker_should_ping helper"). On 2017-07-08, Guenter wrote [1] It is sufficiently different to handle_boot_enabled to keep it separate. I am mostly ok with the patch. One comment below. That one comment (regarding the placement of the module_param) has been addressed in this version. There has been some opposition to making the default value of watchdog.open_timeout configurable in Kconfig, but in [2] Guenter said I used to be opposed to it, but it does seem to make some sense to me now after thinking about it. I do hope that these patches can now find their way into the kernel, but if 2/2 is somehow still controversial, please consider just taking 1/2. (I can't help but noting that handle_boot_enabled does get its default value from Kconfig, and nobody complained about that when that option was added). [1] https://patchwork.kernel.org/patch/9754095/ [2] https://patchwork.kernel.org/patch/9754093/ Rasmus Villemoes (2): watchdog: introduce watchdog.open_timeout commandline parameter watchdog: introduce CONFIG_WATCHDOG_OPEN_TIMEOUT Documentation/watchdog/watchdog-parameters.txt | 9 +++++++++ drivers/watchdog/Kconfig | 9 +++++++++ drivers/watchdog/watchdog_dev.c | 27 +++++++++++++++++++++++++- 3 files changed, 44 insertions(+), 1 deletion(-) -- 2.7.4 From 1585347315545683087@xxx Tue Nov 28 21:36:57 +0000 2017 X-GM-THRID: 1585347315545683087 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread