[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACPK8XfBphFYxJKbHBWLjZFOOVt6m-c7fDZvFwqbBNx+0dm+DQ@mail.gmail.com>
Date: Mon, 5 Mar 2018 16:13:28 +1030
From: Joel Stanley <joel@....id.au>
To: Guenter Roeck <linux@...ck-us.net>
Cc: Wim Van Sebroeck <wim@...ux-watchdog.org>,
Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>,
LINUXWATCHDOG <linux-watchdog@...r.kernel.org>,
devicetree <devicetree@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Tomer Maimon <tmaimon77@...il.com>,
Avi Fishman <avifishman70@...il.com>,
Brendan Higgins <brendanhiggins@...gle.com>
Subject: Re: [PATCH 2/2] watchdog: Add Nuvoton NPCM watchdog driver
On Sat, Mar 3, 2018 at 12:29 AM, Guenter Roeck <linux@...ck-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
Powered by blists - more mailing lists