From patchwork Sun Feb 11 20:08:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcus Folkesson X-Patchwork-Id: 10211463 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 01430602CB for ; Sun, 11 Feb 2018 20:19:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E22DE289E8 for ; Sun, 11 Feb 2018 20:19:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D4EDB28A9A; Sun, 11 Feb 2018 20:19:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 14662289E8 for ; Sun, 11 Feb 2018 20:19:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=dq0F0PEz3Tm90fZD7y59up2Sen8nxNjg09Yci0Pg0pI=; b=X3I7DDcs9iHKf9QNyUnFqnooWb sgGHLFAceBrPub96TW2pZQHApc6KJ/xkWwfyWu5rL5kzxxmM2d606nRnd2JZAawGM+Z4eU03CnSPN 5TiPuTPSP317NOfENI1B1VIbN7hofzMDozlpf1QB+3xg+Jeil68rUbBtexEK1EGSauDYMfAK9KCBl Kn46PdDoGRTKjLqZ6mQr24TslfBnsid6+RLualYqAcWqqzyBTrpkNxGVsVs/g0/JSxz60rhV7O9ZG g5GIIripElxHHdAVLTZibLQVVfvXCgFkAnbEW94YwliFYLx5Z4XIFoiirtEYK7JXfVsfNYtTq5ahh EgJE0QjQ==; Received: from [198.137.202.133] (helo=bombadil.infradead.org) by casper.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eky6C-00087k-Ct for patchwork-linux-arm@patchwork.kernel.org; Sun, 11 Feb 2018 20:19:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=dq0F0PEz3Tm90fZD7y59up2Sen8nxNjg09Yci0Pg0pI=; b=CsUBp3O1rukjcv17Pyd/oaewbR B7csYUefn+qqJAo72xcoK/MQOMRg5bzSK2SDoSiNW0dRt25kXFfqlWNewkbEGklFVsVq082zK5p+F 8kWolXFQsx07OHUUbc2SVkd+dLSpC3lhwyWdZsEe5OxR41kOam54tMDm3qq9UR6zDoyEfdZo9xVaG P6QFZ/iUyAZCqPIt1BtqvCWf7obxrghlLdYChB7g884G8+evLOTMP1oxSxIce8gZUVZolWDGFko6/ Y0hTP/30ZnyoUt7KsQ2IqQBNli1gHQDyPRcKvyva5DmMR8Qdv7AHzPBoAPnYGkK3aMg9t6PuclmJM y1g/2yyQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ekxxQ-0005wF-PH; Sun, 11 Feb 2018 20:10:40 +0000 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ekxwL-00039x-TC; Sun, 11 Feb 2018 20:09:35 +0000 Received: by mail-lf0-x243.google.com with SMTP id a204so17797514lfa.2; Sun, 11 Feb 2018 12:09:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8YcBHPSO6OHE3zPi/Lolt6I4qqC5i6SjQDa3lBvJSJo=; b=qzrG1hvUkq7yWuI5fP1lBn6lQuBtthmKn3OL9599U1Ph2cDmXDjxDxj2mXBNgep3n8 dvOBPrR/m7InPnxDCsXT8cSERZp7zKN2AC/9FZi+cm7vtkeS/b1IWjqmPWMB70yiuNj7 ckmfd+DlpA2j8uDNU5KvmhFJ6erH+ABrLsyU85zprQo51MpgGiDAW10zCIexO9BLWYFx Z1nVmHr8DowmqgBByPEe9qDA3o6yUxBXRoXWLoqlHObzT5IkrdBqQ8ulRI1GTK3zU9/1 RXb9OoC1KZIRDviTdTstbJEXV50tihRkBftxK6yH+zopQL2/IqB0sZ6iqfwrAhg14Sqk 9FwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8YcBHPSO6OHE3zPi/Lolt6I4qqC5i6SjQDa3lBvJSJo=; b=eqMyNVPaNJ3R1XTYdbYTJwK3I2sSI4R9SigVA1JZN7gDPmgV2cc6mKukLrGO0Sei12 /PidnrjMpfPGySCMKOnXvBQ88FKGzdbgE0Tvslk/L6xZBl37HozeJxjPQHp4c4+8fzuz /YYFBVE4WSHR64daKT6oidRx0e5rucSv3nle5/1Tkn2kYLwV5+lNlCevjHTiS+3KU/38 TLlnpPyzzf9BYm2xK2B0TJEnCQ0PuFUW4VJXMedLDiNK1QAri39GWEX1l9oFupv/IAnQ YbyDjjg2riZHP5TqG3bUsObOBR3B4XfUhiR/034SYNHFDUf2aX/6DpzBH50hZSrrCD1Q GjGw== X-Gm-Message-State: APf1xPB/YYMfLf9OgtEgOvneh3LsIb7irP127ZvhZ/w++qeer/0deZZH xGfRFHuxhtbFV227039Dbk8= X-Google-Smtp-Source: AH8x227IOn/cqxygiOSPRjPRHQWXrkRKRTzJ/OLrZSvdBmwonAEyY8LEz0sWoELLwH9bONbuE6Co4A== X-Received: by 10.25.168.141 with SMTP id r135mr6369761lfe.80.1518379761906; Sun, 11 Feb 2018 12:09:21 -0800 (PST) Received: from localhost.localdomain (c-2ec27091-74736162.cust.telenor.se. [46.194.112.145]) by smtp.gmail.com with ESMTPSA id c21sm927549lfb.13.2018.02.11.12.09.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Feb 2018 12:09:20 -0800 (PST) From: Marcus Folkesson To: Wim Van Sebroeck , Guenter Roeck , Rob Herring , Mark Rutland , Carlo Caione , Kevin Hilman , Matthias Brugger , Barry Song , Maxime Ripard , Chen-Yu Tsai , Linus Walleij , Vladimir Zapolskiy , Sylvain Lemieux , Nicolas Ferre , Alexandre Belloni Subject: [PATCH v3 3/7] watchdog: sirfsoc: allow setting timeout in devicetree Date: Sun, 11 Feb 2018 21:08:43 +0100 Message-Id: <20180211200847.25000-3-marcus.folkesson@gmail.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180211200847.25000-1-marcus.folkesson@gmail.com> References: <20180211200847.25000-1-marcus.folkesson@gmail.com> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Marcus Folkesson , linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org 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 watchdog_init_timeout() will allways pick timeout_param since it defaults to a valid timeout. By following best practice described in Documentation/watchdog/watchdog-kernel-api.txt, it also let us to set timout-sec property in devicetree. Signed-off-by: Marcus Folkesson Reviewed-by: Guenter Roeck Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt | 4 ++++ drivers/watchdog/sirfsoc_wdt.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt b/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt index 9cbc76c89b2b..0dce5e3100b4 100644 --- a/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt +++ b/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt @@ -5,10 +5,14 @@ Required properties: - reg: Address range of tick timer/WDT register set - interrupts: interrupt number to the cpu +Optional properties: +- timeout-sec : Contains the watchdog timeout in seconds + Example: timer@b0020000 { compatible = "sirf,prima2-tick"; reg = <0xb0020000 0x1000>; interrupts = <0>; + timeout-sec = <30>; }; diff --git a/drivers/watchdog/sirfsoc_wdt.c b/drivers/watchdog/sirfsoc_wdt.c index 4eea351e09b0..ac0c9d2c4aee 100644 --- a/drivers/watchdog/sirfsoc_wdt.c +++ b/drivers/watchdog/sirfsoc_wdt.c @@ -29,7 +29,7 @@ #define SIRFSOC_WDT_MAX_TIMEOUT (10 * 60) /* 10 mins */ #define SIRFSOC_WDT_DEFAULT_TIMEOUT 30 /* 30 secs */ -static unsigned int timeout = SIRFSOC_WDT_DEFAULT_TIMEOUT; +static unsigned int timeout; static bool nowayout = WATCHDOG_NOWAYOUT; module_param(timeout, uint, 0);