[<prev] [next>] [day] [month] [year] [list]
Message-ID: <d0e2beb8-1bb2-ba9d-f600-aaf435663dcf@roeck-us.net>
Date: Thu, 21 Apr 2022 22:50:29 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: liuxp11 <liuxp11@...natelecom.cn>, wim <wim@...ux-watchdog.org>
Cc: linux-watchdog <linux-watchdog@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Watchdog: Checking timeout invalid if hardware heartbeat
range is configured
On 4/21/22 16:31, liuxp11 wrote:
> > diff --git a/drivers/watchdog/wdat_wdt.c b/drivers/watchdog/wdat_wdt.c
>
> > index 195c8c004b69..d166d33ce7ae 100644
> > --- a/drivers/watchdog/wdat_wdt.c
> > +++ b/drivers/watchdog/wdat_wdt.c
> > @@ -450,8 +450,7 @@ static int wdat_wdt_probe(struct platform_device *pdev)
> > * watchdog properly after it has opened the device. In some cases
> > * the BIOS default is too short and causes immediate reboot.
> > */
> > - if (timeout * 1000 < wdat->wdd.min_hw_heartbeat_ms ||
> > - timeout * 1000 > wdat->wdd.max_hw_heartbeat_ms) {
> > + if (watchdog_timeout_invalid(&wdat->wdd, timeout)) {
> > dev_warn(dev, "Invalid timeout %d given, using %d\n",
> > timeout, WDAT_DEFAULT_TIMEOUT);
> > timeout = WDAT_DEFAULT_TIMEOUT;
> Thanks your reply, read these code,thinking can put them into watchdog_timeout_invalid.
Again, no. If anything the above code is wrong; there should be no
upper limit if max_hw_heartbeat_ms is provided. The code should
probably set min_timeout and just call watchdog_timeout_invalid()
without any change in that function.
Guenter
Powered by blists - more mailing lists