From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 63595274B3B for ; Fri, 10 Apr 2026 00:53:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775782436; cv=none; b=PM65ojQ6VdtQCC4eLcNkT9MenO6YR/dMI4Tru3PKfa3o5Gwgpc2522bIWRnt9/mYPQh0VwiRtYsuKyeYPWMM/FGsuDt5Mft6iKSM8T55CrPrUFafvKFsxEPNUyjMvbqXujsEHSuKMEjVpbgUVO3KKYzun53CyJFwj7r39liIAO8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775782436; c=relaxed/simple; bh=OTmZ+oGMVvjRnvXG6OGGFurCLhilKvD8WsmlC0/3ZRc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=IOD7Us0op3oF9kj76EWKtsoKZHpsqYLRL4oRmSxv77BHyO6yzN39F6ZnFaK7FvjHkNMAlADezSdrgeriLN182XZzZzWvVRrAMESkKmtQATglqvyDBUWwKRFnwOlCh9EYN3yV5Gtl06sdRDJ56WkUNWOYHkW+yZzNo7NmlODCEi0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=BYlRta/W; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BYlRta/W" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-2b25cf1b5f0so11244075ad.3 for ; Thu, 09 Apr 2026 17:53:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775782435; x=1776387235; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:sender:from:to:cc:subject:date:message-id:reply-to; bh=zlPpzT2EYibWjmLAuoWUFVaCZoy5o7mnT06yLl6p+LU=; b=BYlRta/Wz+IZgqSmPPlWSm8dMjQS3mdzTZihgoHSPPrn0YM133hqfhQ+r0gtJQJytK DkIIADga1kYHqEtpHkYlq7P5VK24rUsUZBjVbdhHpsxQHUhd8+ScnescvuBkoaB5NOLE ogR4Q2XxHB29NPVJn2/OgTb3VrNTnwB5R6/BTMcITYrUDh6bo7txvwq+4+Q1mIs29cZ1 zhrhs/heYduEU1MmYKwubHrd9gCTT+juXyi0U+sU7GmLIaPJSCjuikEbXu4y9iUDGInU j0ccpvYMODlhDAg6xYfqu6jiHuHqPpT7ucV4mfoz6c+HDRNj9Edx4hoYI2XtpiAP9KBS k12w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775782435; x=1776387235; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:sender:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zlPpzT2EYibWjmLAuoWUFVaCZoy5o7mnT06yLl6p+LU=; b=S6nKy/EAvQhBIAOGpz0zSV/eMJUr9Y2NQFCMU5d630NFC5IUOwA3b2Ctf5UYWtnbI9 70rWW0z4553c1TfIrLSUhDLb6CPzTB0mpTChodJU4xsJTjk7RgwUcHd6YGmtb8T42SzI lqP7CKcxMh/fkryrUYShURFpubuIOHc/MImAcHjsXmfSbCpSTFZquVm3GGzSupBfwvB0 M7+RY18Y6VFR6UYz+BgCvGsHUKoemuJvCYiPRfaNZHhfn8XF/GHmBiUJttw3+PXTGA1k 4trXRT1djKvork0MC4+Gd5and6i62ruNG8DxNpkzaO0CZHd0UzlEfdIGb/GN0dxkIH3s b6pg== X-Forwarded-Encrypted: i=1; AJvYcCUfvV4NDpQINofvJyEhqXp1loHtg8vo4Jq9ZCwQln7ne+DiuMFdgqbgG8aqtKUZozCFB/mWWdFC8dJ6XVw=@vger.kernel.org X-Gm-Message-State: AOJu0YwC+1svQEg/VE9JVDidwzNCfnrwnJH1ih8L2Pkfydd8fMjj0Pae zKbku2wsJt4mws9yfSJYfLOJxMC8Eq14ftDNGKhOC+6/CZWRx+LbghuX X-Gm-Gg: AeBDiesZL/uD7NSxR0abANXR6NNGlTECmuGpsfsUCKXXLxfJV3/0nOwiTE5rSkPwKBU U8CAlQQHp3ZygRWD+aQSqcvGSIJ7t+JGWmxrM3OkF2Dv/6G/fVZQrBS0BZDmDkwtA/tFfZpjhi4 Af0YMkFq65WZWvKiqbOMzw4V600VBbPQBlWQie0tvZVFMlUv34nFbeIeqlR7pQZayj9htBQsn/I k8LGmvkKl5mEKHZ4nx+0HAKt3RDnRX1YDijuRQJxl1pE1KLCAGWym/KhP57cchcMxGVkjBUPTqM aQDoD8aS/MSvPCYt82ONzC6aCnds+QALJ8CwOzTVvUTm4FhoPhN7T0xYpkPlZd3JnDafRl+F6Uv foxnOdnQl8j1MiT9376H1DqGzrsPfqtESnOVb5/DEp8Yp35gIS6DqPqQ/erqWRv7qA+2/rtqdxo KDxh83zEcZRj4DHLao9pD5VFqh2zEz0OS2AvHWyI5UH13Qi++w9O+SOFyB2P5kZRy2TkNEe0b+ X-Received: by 2002:a17:903:1211:b0:2b2:4b4e:e4d8 with SMTP id d9443c01a7336-2b2d591b8aemr9022925ad.4.1775782434748; Thu, 09 Apr 2026 17:53:54 -0700 (PDT) Received: from ?IPV6:2600:1700:e321:62f0:da43:aeff:fecc:bfd5? ([2600:1700:e321:62f0:da43:aeff:fecc:bfd5]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b2d4dabe98sm8061865ad.6.2026.04.09.17.53.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Apr 2026 17:53:54 -0700 (PDT) Sender: Guenter Roeck Message-ID: <132f7e64-4fc6-4274-a04e-e53f0b957665@roeck-us.net> Date: Thu, 9 Apr 2026 17:53:52 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Documentation: Refactored watchdog old doc To: Sunny Patel , Jonathan Corbet Cc: Wim Van Sebroeck , Shuah Khan , linux-watchdog@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260409175301.22902-1-nueralspacetech@gmail.com> Content-Language: en-US From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8W3qC1+w+RdMUrZxKGWJ3juwcgveJlzMp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687WuNMC6CcFd6j72kRfxklOqXw zvy+2NEcXyziiLXp84130yxAKXfluax9sZhhrhKT6VrD45S6N3HxJpXQ/RY/EX35neH2/F7B RgSloce2+zWfpELyS1qRkCUTt1tlGV2p+y2BPfXzrHn2vxvbhEn1QpQ6t+85FKN8YEhJEygJ F0WaMvQMNrk9UAUziVcUkLU52NS9SXqpVg8vgrO0JKx97IXFPcNh0DWsSj/0Y8HO/RDkGXYn FDMj7fZSPKyPQPmEHg+W/KzxSSfdgWIHF2QaQ0b2q1wOSec4Rti52ohmNSY+KNIW/zODhugJ np3900V20aS7eD9K8GTU0TGC1pyz6IVJwIE= In-Reply-To: <20260409175301.22902-1-nueralspacetech@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/9/26 10:53, Sunny Patel wrote: > Revisited old doc of watchdog and did some cleanup. > Also added support for new api in doc. > > Signed-off-by: Sunny Patel > --- > Documentation/watchdog/watchdog-api.rst | 49 +++++++++++++++++++++---- > 1 file changed, 41 insertions(+), 8 deletions(-) > > diff --git a/Documentation/watchdog/watchdog-api.rst b/Documentation/watchdog/watchdog-api.rst > index 78e228c272cf..446f961852ec 100644 > --- a/Documentation/watchdog/watchdog-api.rst > +++ b/Documentation/watchdog/watchdog-api.rst > @@ -2,7 +2,7 @@ > The Linux Watchdog driver API > ============================= > > -Last reviewed: 10/05/2007 > +Last reviewed: 04/08/2026 > > > > @@ -106,11 +106,10 @@ the requested one due to limitation of the hardware:: > This example might actually print "The timeout was set to 60 seconds" > if the device has a granularity of minutes for its timeout. > > -Starting with the Linux 2.4.18 kernel, it is possible to query the > -current timeout using the GETTIMEOUT ioctl:: > +It is also possible to get the current timeout with the GETTIMEOUT ioctl:: > > ioctl(fd, WDIOC_GETTIMEOUT, &timeout); > - printf("The timeout was is %d seconds\n", timeout); > + printf("The timeout is %d seconds\n", timeout); > > Pretimeouts > =========== > @@ -133,7 +132,7 @@ seconds. Setting a pretimeout to zero disables it. > There is also a get function for getting the pretimeout:: > > ioctl(fd, WDIOC_GETPRETIMEOUT, &timeout); > - printf("The pretimeout was is %d seconds\n", timeout); > + printf("The pretimeout is %d seconds\n", timeout); > > Not all watchdog drivers will support a pretimeout. > > @@ -145,7 +144,7 @@ before the system will reboot. The WDIOC_GETTIMELEFT is the ioctl > that returns the number of seconds before reboot:: > > ioctl(fd, WDIOC_GETTIMELEFT, &timeleft); > - printf("The timeout was is %d seconds\n", timeleft); > + printf("The timeout is %d seconds\n", timeleft); > > Environmental monitoring > ======================== > @@ -227,12 +226,33 @@ The watchdog saw a keepalive ping since it was last queried. > WDIOF_SETTIMEOUT Can set/get the timeout > ================ ======================= > > -The watchdog can do pretimeouts. > +The watchdog supports timeout set/get via the WDIOC_SETTIMEOUT and > +WDIOC_GETTIMEOUT ioctls. > > ================ ================================ > WDIOF_PRETIMEOUT Pretimeout (in seconds), get/set > ================ ================================ > > +The watchdog supports a pretimeout, a warning interrupt that fires before > +the actual reboot tiemout. USE WDIOC_SETPRETIMEOUT and WDIOC_GETPRETIMEOUT > +to set/get the pretimeout. > + > + ================ ================================ > + WDIOF_MAGICCLOSE Supports magic close char > + ================ ================================ > + > +The driver supports the Magic Close feature, The watchdog is only disabled > +if the characted 'V' is written to /dev/watchdog before the file descriptor > +is closed. Without this, closing the device disables the watchdog > +unconditionally. > + > + ================ ================================ > + WDIOF_ALARMONLY Not a reboot watchdog > + ================ ================================ > + > +The watchdog will not reboot the system when it expires. Instead it > +triggers a management or other external alarm. Userspace should not > +rely on a system reboot occurring. > > For those drivers that return any bits set in the option field, the > GETSTATUS and GETBOOTSTATUS ioctls can be used to ask for the current > @@ -268,4 +288,17 @@ The following options are available: > WDIOS_TEMPPANIC Kernel panic on temperature trip > ================= ================================ > > -[FIXME -- better explanations] > +``WDIOS_DISABLECARD`` stops the watchdog timer. The driver will cease > +pinging the hardware watchdog, allowing a controlled shutdown without > +a forced reboot. This is equivalent to the watchdog being disarmed. > + > +``WDIOS_ENABLECARD`` starts the watchdog timer. if the watchdog was > +previously stopped via ``WDIOS_DISABLECARD``,this will re-enable it. The > +hardware watchdog will begin counting down from the configured timeout. > + > +``WDIOS_TEMPPANIC`` enables temperature-based kernel panic. When set, > +the driver will call ``panic()`` (or ``kernel_power_off()`` on some > +drivers) if the hardware temperature sensor exceeds its threshold, > +rather than only setting the ``WDIOF_OVERHEAT`` status bit. Support > +for this option is driver-specific, not all watchdog drivers implement > +temperature monitoring. > \ No newline at end of file FWIW, I think if we update the document, all functionality not supported by the watchdog core (specifically but not necessarily limited to WDIOS_TEMPPANIC) should be declared/marked deprecated. Guenter