lkml.org 
[lkml]   [2022]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] Watchdog: Checking timeout invalid if hardware heartbeat range is configured
From
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

\
 
 \ /
  Last update: 2022-04-22 07:52    [W:0.042 / U:2.720 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site