lkml.org 
[lkml]   [2018]   [Mar]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 2/2] watchdog: Add Nuvoton NPCM watchdog driver
On Sat, Mar 3, 2018 at 12:29 AM, Guenter Roeck <linux@roeck-us.net> wrote:
>> +static int npcm_wdt_start(struct watchdog_device *wdd)
>> +{
>> + struct npcm_wdt *wdt = to_npcm_wdt(wdd);
>> + u32 val;
>> +
>> + val = NPCM_WTRE | NPCM_WTE | NPCM_WTR | NPCM_WTIE;
>> +
>> + if (wdd->timeout < 2)
>> + val |= 0x800;
>> + else if (wdd->timeout < 3)
>> + val |= 0x420;
>> + else if (wdd->timeout < 6)
>> + val |= 0x810;
>> + else if (wdd->timeout < 11)
>> + val |= 0x430;
>> + else if (wdd->timeout < 22)
>> + val |= 0x820;
>> + else if (wdd->timeout < 44)
>> + val |= 0xC00;
>> + else if (wdd->timeout < 87)
>> + val |= 0x830;
>> + else if (wdd->timeout < 173)
>> + val |= 0xC10;
>> + else if (wdd->timeout < 688)
>> + val |= 0xC20;
>> + else if (wdd->timeout < 2751)
>> + val |= 0xC30;
>> + else
>> + val |= 0x830;
>
>
> I am lost here. If the requested timeout is 2751, the actual timeout
> is set to 85.6 seconds. Why ?
>

I suspect this was the default, so the original code decided to fall
back to this value.

I think it would make more sense to use 2750.

Cheers,

Joel

\
 
 \ /
  Last update: 2018-03-05 06:45    [W:0.100 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site