devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joel Stanley <joel@jms.id.au>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Wim Van Sebroeck <wim@linux-watchdog.org>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	LINUXWATCHDOG <linux-watchdog@vger.kernel.org>,
	devicetree <devicetree@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Tomer Maimon <tmaimon77@gmail.com>,
	Avi Fishman <avifishman70@gmail.com>,
	Brendan Higgins <brendanhiggins@google.com>
Subject: Re: [PATCH 2/2] watchdog: Add Nuvoton NPCM watchdog driver
Date: Mon, 5 Mar 2018 16:13:28 +1030	[thread overview]
Message-ID: <CACPK8XfBphFYxJKbHBWLjZFOOVt6m-c7fDZvFwqbBNx+0dm+DQ@mail.gmail.com> (raw)
In-Reply-To: <684152b5-4992-68b5-5abf-78ea2d6b34bc@roeck-us.net>

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

      reply	other threads:[~2018-03-05  5:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-02  6:37 [PATCH 0/2] watchdog: Add Nuvoton NPCM (Poleg) driver Joel Stanley
2018-03-02  6:37 ` [PATCH 1/2] dt-bindings: watchdog: Add Nuvoton NPCM description Joel Stanley
2018-03-02 11:24   ` Marcus Folkesson
2018-03-02  6:37 ` [PATCH 2/2] watchdog: Add Nuvoton NPCM watchdog driver Joel Stanley
2018-03-02 11:20   ` Marcus Folkesson
2018-03-05  5:42     ` Joel Stanley
2018-03-02 13:59   ` Guenter Roeck
2018-03-05  5:43     ` Joel Stanley [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=CACPK8XfBphFYxJKbHBWLjZFOOVt6m-c7fDZvFwqbBNx+0dm+DQ@mail.gmail.com \
    --to=joel@jms.id.au \
    --cc=avifishman70@gmail.com \
    --cc=brendanhiggins@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=tmaimon77@gmail.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;
as well as URLs for NNTP newsgroup(s).