Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp7207569pxv; Fri, 30 Jul 2021 12:40:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz61pRwzLfjH2NYw+GeWBeueD4qrA4S7DXfYVFuub2M8mCC7qg5juwvlg5DHC6cFfjmq7qb X-Received: by 2002:a92:d78a:: with SMTP id d10mr3024001iln.303.1627674012437; Fri, 30 Jul 2021 12:40:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627674012; cv=none; d=google.com; s=arc-20160816; b=BGm5bILeN2uwvDsLTNsVx5o2J5SQssODvsL8FNY0pg3lT1tfqxomcYsz3NHJcOv43n EmGT8u6ja1fGZ1MFcQh2siGhd3Rp8CyxNL9mXlrxxIlhAScpvSZbDnGz/pIKGUNAeH0I 0lBjo1KrG7M+RRBqQAfKx8Q9nK8X9wp8wzMirDSHuJTUjp3irlAFtfRVj8VId8kFJ/ax iFi/39/UYuCeSUW7hxVP4LasEyrHesgpwORsny+pouZn3r1i+jCv9PK8eLt+aK9Q+et1 gE3dF14YBzlLK6TyGuoKmgf/0vV2yxDdCGzy2w01Lk5/FdbqOr3vSWwZkNalRv/zD8Yi R1lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:user-agent:date:message-id:cc:to:subject:from; bh=CaVdtaB8XpEtO6951DqQuvYCLxZFpQY1R59kTuGpG0g=; b=xgo9Siomn8juSjGyiT9gXKIeSNE7hHNxc+1+jtDVlRH4+UJSNp7UZHwhreJ1ySVFSZ ypq8/meCq30jVHJaiZEpF9RSuhK710c88SSEuApHaO4aOrwxCnWyRzzXgn+u4tTa+32x XxZWSFgn/I9n4ot8IDSuAzCW9sL4PKKcTf8zOyN9LQ3CvsrDg9EIlP6801Gdv3795gyJ 2GwuZH+6B5l8WMvXQNiHSpyas3PWxZ6vmBm7Q1MkiHiuFEFpvgHnzO0uHsDFJ1mBfwyq uUBj7WR8ThJSlBkpm6wNek0sdFyNHnQcCCH6zAjiZ85OYWLo3b+dTLg67uvlxRc+uUFZ i6Ag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z5si129673ioq.70.2021.07.30.12.40.00; Fri, 30 Jul 2021 12:40:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230475AbhG3TjZ (ORCPT + 99 others); Fri, 30 Jul 2021 15:39:25 -0400 Received: from david.siemens.de ([192.35.17.14]:48202 "EHLO david.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230335AbhG3TjY (ORCPT ); Fri, 30 Jul 2021 15:39:24 -0400 Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id 16UJd19b024569 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Jul 2021 21:39:02 +0200 Received: from [167.87.33.191] ([167.87.33.191]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 16UJd0Vc012541; Fri, 30 Jul 2021 21:39:01 +0200 From: Jan Kiszka Subject: [PATCH] watchdog: Respect handle_boot_enabled when setting last last_hw_keepalive To: Guenter Roeck , Wim Van Sebroeck , linux-watchdog@vger.kernel.org Cc: Linux Kernel Mailing List , Tero Kristo Message-ID: Date: Fri, 30 Jul 2021 21:39:00 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jan Kiszka We must not pet a running watchdog when handle_boot_enabled is off because this requests to only start doing that via userspace, not during probing. Signed-off-by: Jan Kiszka --- drivers/watchdog/watchdog_dev.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c index 3bab32485273..3c93d00bb284 100644 --- a/drivers/watchdog/watchdog_dev.c +++ b/drivers/watchdog/watchdog_dev.c @@ -1172,7 +1172,10 @@ int watchdog_set_last_hw_keepalive(struct watchdog_device *wdd, wd_data->last_hw_keepalive = ktime_sub(now, ms_to_ktime(last_ping_ms)); - return __watchdog_ping(wdd); + if (handle_boot_enabled) + return __watchdog_ping(wdd); + + return 0; } EXPORT_SYMBOL_GPL(watchdog_set_last_hw_keepalive); -- 2.31.1