mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jean Delvare <jdelvare@suse.de>
To: linux-watchdog@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Cc: Wim Van Sebroeck <wim@linux-watchdog.org>,
	Guenter Roeck <linux@roeck-us.net>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Liu Xinpeng <liuxp11@chinatelecom.cn>
Subject: Re: [PATCH v2] watchdog: wdat_wdt: Set the min and max timeout values properly
Date: Tue, 23 Aug 2022 15:00:03 +0200	[thread overview]
Message-ID: <20220823150003.6199b8fd@endymion.delvare> (raw)
In-Reply-To: <20220806081524.5636461a@endymion.delvare>

Hi all,

On Sat, 6 Aug 2022 08:15:24 +0200, Jean Delvare wrote:
> The wdat_wdt driver is misusing the min_hw_heartbeat_ms field. This
> field should only be used when the hardware watchdog device should not
> be pinged more frequently than a specific period. The ACPI WDAT
> "Minimum Count" field, on the other hand, specifies the minimum
> timeout value that can be set. This corresponds to the min_timeout
> field in Linux's watchdog infrastructure.
> 
> Setting min_hw_heartbeat_ms instead can cause pings to the hardware
> to be delayed when there is no reason for that, eventually leading to
> unexpected firing of the watchdog timer (and thus unexpected reboot).
> (...)

This patch no longer applies as it conflicts with:

commit 6d72c7ac9fbe26a77800676507da980436b40b2f
Author: Liu Xinpeng
Date:   Tue Apr 26 22:53:28 2022 +0800

which made it into kernel v5.19.

Having reviewed the commit mentioned above, I must say I'm skeptical. I
can't see how setting min_timeout to 1 arbitrarily has been considered
a good thing. This allows setting timeout values lower than the ACPI
WDAT "Minimum Count" field, while presumably the hardware does not
support such short timeouts.

Furthermore, calling watchdog_timeout_invalid() to validate the timeout
value is a good idea in principle, however, given that min_timeout is
now 1 and max_hw_heartbeat_ms is defined, the function is no longer
checking much.

My understanding is that the original code was checking the right
limits (from the WDAT table's perspective) using the wrong fields (from
the watchdog core's perspective). This fix from Liu is not really fixing
the problem (min_hw_heartbeat_ms and max_hw_heartbeat_ms are still set,
which enables watchdog core facilities that the driver doesn't need
IMHO) and is adding a new problem (the timeout limits defined in the
ACPI WDAT table are no longer checked).

I will rebase my patch on top and address both problems.

-- 
Jean Delvare
SUSE L3 Support

      parent reply	other threads:[~2022-08-23 16:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-06  6:15 Jean Delvare
2022-08-08 11:42 ` Guenter Roeck
2022-08-23 13:00 ` Jean Delvare [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220823150003.6199b8fd@endymion.delvare \
    --to=jdelvare@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=liuxp11@chinatelecom.cn \
    --cc=mika.westerberg@linux.intel.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=wim@linux-watchdog.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®