Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp7280113pxv; Fri, 30 Jul 2021 14:41:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwoMr5kKBf6P5xz/Bot8UpqCQyLRJocMrdgVxS1w/WW2YyIgmdUowI0zIylqm24rsa2gBMA X-Received: by 2002:a17:906:1da1:: with SMTP id u1mr4672344ejh.307.1627681318574; Fri, 30 Jul 2021 14:41:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627681318; cv=none; d=google.com; s=arc-20160816; b=PFZGasYl6sGoW3llQToRKYu5BouZBwMRWiO7PbwkBFE1ENtXz9251d2REvya/0tYga AGVRqLAObsVKGWjM8JuGJP1fk1mgyVaC244HcQrew80qe0hTr5EqeTBVrnbaMW+pxZDj ZnWweXyNmD7OqN6PDi4zrFjNCIqMCAFV+Y4GVtIEhmfmCJW3tFyFKB4sl3Bx4aXmVHM8 jdd/TJppBEY8VAECWtzLgwlBQPL0ucEsxW/wsC9KwRpN1fQPE9tnc3lgENXgtAzkqKJV GJcfQubGe3USLyGTmZ4pzM8LLgGJFcyJc3TobIiV13grMZPOuzA9iEVKotNCSQJFcEhK bOQw== 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 :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=QhTDBVfO8X150P4kAt1SN0EWP50f/8kEthSwgxSBON0=; b=bQqz3AfxpQxFtZlwh8ESaXx36xZfLrpn4e0MsYJdjkwiZdt8T/uJgQQBehneSuk6bW hetwOvcYgq/Fy09f0sAfpdPUrLMzW/cUzvwWUzJ4WB0NtI/+oS83BZBopAsxvYa1v0gF nj9R6G+fF4rhgoynRXrvEYtHjCxF++Zphi5taQSjAi7zLW15Nykf3ApUJHhkM6O+CwUF WU/YTYJ+peqDGzdqo32h1dsawwbVNhrZH2e1luefnaFBtpMtPM0doF5ACA48drblOB8F P0LxCKXbmlewvfd5DkRiNUL6P9NIqlPoFRkw+5NZ2Be9hwR76tN+h54d4bPGL0QxfKp8 QpAA== 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 z18si3030757ejx.339.2021.07.30.14.41.35; Fri, 30 Jul 2021 14:41:58 -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 S231939AbhG3Vh4 (ORCPT + 99 others); Fri, 30 Jul 2021 17:37:56 -0400 Received: from david.siemens.de ([192.35.17.14]:42303 "EHLO david.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231208AbhG3Vhw (ORCPT ); Fri, 30 Jul 2021 17:37:52 -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 16ULbSmE018382 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Jul 2021 23:37:28 +0200 Received: from [167.87.33.191] ([167.87.33.191]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 16ULbSA3026692; Fri, 30 Jul 2021 23:37:28 +0200 Subject: Re: [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 References: <211cd54b-29b4-e58a-341b-beffc05cfe85@roeck-us.net> From: Jan Kiszka Message-ID: Date: Fri, 30 Jul 2021 23:37:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <211cd54b-29b4-e58a-341b-beffc05cfe85@roeck-us.net> 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 On 30.07.21 22:49, Guenter Roeck wrote: > On 7/30/21 12:39 PM, Jan Kiszka wrote: >> 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. >> > > The scope of the changed function is quite limited. See the > definition of watchdog_set_last_hw_keepalive(). On top of that, > __watchdog_ping() does a bit more than just ping the watchdog, > and it only pings the watchdog in limited circumstances. On top of that, > the scope of handle_boot_enabled is different: If enabled, it tells > the watchdog core to keep pinging a watchdog until userspace opens > the device. This is about continuous pings, not about an initial one. > Given that, I'd rather have the watchdog subsystem issue an additional > ping than risking a regression. > > The only driver calling watchdog_set_last_hw_keepalive() is rti_wdt.c. > Does this patch solve a specific problem observed with that watchdog ? Yes, it unbreaks support for handle_boot_enabled=no by not starting the automatic pinging of the kernel until userspace opens the device. Without this fix, the core will prematurely start kernel-side pinging, and hanging userspace will never be detected. Jan -- Siemens AG, T RDA IOT Corporate Competence Center Embedded Linux