All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Joel Stanley <joel@jms.id.au>
Cc: wim@iguana.be, linux-watchdog@vger.kernel.org,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	Jeremy Kerr <jk@ozlabs.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH 2/2] watchdog: Add Aspeed watchdog driver
Date: Tue, 10 May 2016 06:25:09 -0700	[thread overview]
Message-ID: <5731E135.8000100@roeck-us.net> (raw)
In-Reply-To: <CACPK8XfK4Qt2GaSL7eVoNkCawbtXqFX9bGRcgyAyq7R2yuSZkA@mail.gmail.com>

Hi Joel,

On 05/10/2016 04:10 AM, Joel Stanley wrote:

[ ... ]

>>> +
>>> +       /*
>>> +        * The ast2400 wdt can run at PCLK, or 1MHz. The ast2500 only
>>> +        * runs at 1MHz. We chose to always run at 1MHz, as there's no
>>> +        * good reason to have a faster watchdog counter.
>>> +        */
>>> +       wdt->rate = 1000000;
>>
>>
>> Why not just use a define ?
>
> I will add one.
>
> The comment is informative though for people who read the ast2400
> datasheet and wonder why we don't provide the option clocking with
> pclk, I will leave it in.
>

The comment is ok. I just find it unnecessary to have a variable
instead of a constant.

[ ... ]
>
>> ctrl is really static except for the enable flag. Not really sure
>> if having a variable for it has any real benefits - you might as well
>> just read the register and update the enable flag instead as needed when
>> starting or stopping the watchdog. Is there a reason for not doing that ?
>
> Not really. I find it cleaner to keep a copy of the register instead
> of read-modify-write, but if you feel strongly about it I can change.
>

No worries. Not worth arguing about.

Guenter


WARNING: multiple messages have this Message-ID (diff)
From: linux@roeck-us.net (Guenter Roeck)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] watchdog: Add Aspeed watchdog driver
Date: Tue, 10 May 2016 06:25:09 -0700	[thread overview]
Message-ID: <5731E135.8000100@roeck-us.net> (raw)
In-Reply-To: <CACPK8XfK4Qt2GaSL7eVoNkCawbtXqFX9bGRcgyAyq7R2yuSZkA@mail.gmail.com>

Hi Joel,

On 05/10/2016 04:10 AM, Joel Stanley wrote:

[ ... ]

>>> +
>>> +       /*
>>> +        * The ast2400 wdt can run at PCLK, or 1MHz. The ast2500 only
>>> +        * runs at 1MHz. We chose to always run at 1MHz, as there's no
>>> +        * good reason to have a faster watchdog counter.
>>> +        */
>>> +       wdt->rate = 1000000;
>>
>>
>> Why not just use a define ?
>
> I will add one.
>
> The comment is informative though for people who read the ast2400
> datasheet and wonder why we don't provide the option clocking with
> pclk, I will leave it in.
>

The comment is ok. I just find it unnecessary to have a variable
instead of a constant.

[ ... ]
>
>> ctrl is really static except for the enable flag. Not really sure
>> if having a variable for it has any real benefits - you might as well
>> just read the register and update the enable flag instead as needed when
>> starting or stopping the watchdog. Is there a reason for not doing that ?
>
> Not really. I find it cleaner to keep a copy of the register instead
> of read-modify-write, but if you feel strongly about it I can change.
>

No worries. Not worth arguing about.

Guenter

WARNING: multiple messages have this Message-ID (diff)
From: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
To: Joel Stanley <joel-U3u1mxZcP9KHXe+LvDLADg@public.gmane.org>
Cc: wim-IQzOog9fTRqzQB+pC5nmwQ@public.gmane.org,
	linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	Jeremy Kerr <jk-mnsaURCQ41sdnm+yROfE0A@public.gmane.org>,
	Benjamin Herrenschmidt
	<benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>,
	Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Subject: Re: [PATCH 2/2] watchdog: Add Aspeed watchdog driver
Date: Tue, 10 May 2016 06:25:09 -0700	[thread overview]
Message-ID: <5731E135.8000100@roeck-us.net> (raw)
In-Reply-To: <CACPK8XfK4Qt2GaSL7eVoNkCawbtXqFX9bGRcgyAyq7R2yuSZkA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Hi Joel,

On 05/10/2016 04:10 AM, Joel Stanley wrote:

[ ... ]

>>> +
>>> +       /*
>>> +        * The ast2400 wdt can run at PCLK, or 1MHz. The ast2500 only
>>> +        * runs at 1MHz. We chose to always run at 1MHz, as there's no
>>> +        * good reason to have a faster watchdog counter.
>>> +        */
>>> +       wdt->rate = 1000000;
>>
>>
>> Why not just use a define ?
>
> I will add one.
>
> The comment is informative though for people who read the ast2400
> datasheet and wonder why we don't provide the option clocking with
> pclk, I will leave it in.
>

The comment is ok. I just find it unnecessary to have a variable
instead of a constant.

[ ... ]
>
>> ctrl is really static except for the enable flag. Not really sure
>> if having a variable for it has any real benefits - you might as well
>> just read the register and update the enable flag instead as needed when
>> starting or stopping the watchdog. Is there a reason for not doing that ?
>
> Not really. I find it cleaner to keep a copy of the register instead
> of read-modify-write, but if you feel strongly about it I can change.
>

No worries. Not worth arguing about.

Guenter

--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2016-05-10 13:25 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-09 12:34 [PATCH 0/2] watchdog: Add Aspeed watchdog driver Joel Stanley
2016-05-09 12:34 ` Joel Stanley
2016-05-09 12:34 ` Joel Stanley
2016-05-09 12:34 ` [PATCH 1/2] doc/devicetree: Add Aspeed watchdog timer bindings Joel Stanley
2016-05-09 12:34   ` Joel Stanley
2016-05-09 12:34   ` Joel Stanley
2016-05-09 20:38   ` Rob Herring
2016-05-09 20:38     ` Rob Herring
2016-05-09 20:38     ` Rob Herring
2016-05-10 11:24     ` Joel Stanley
2016-05-10 11:24       ` Joel Stanley
2016-05-10 11:24       ` Joel Stanley
2016-05-09 12:34 ` [PATCH 2/2] watchdog: Add Aspeed watchdog driver Joel Stanley
2016-05-09 12:34   ` Joel Stanley
2016-05-09 12:34   ` Joel Stanley
2016-05-09 14:48   ` Guenter Roeck
2016-05-09 14:48     ` Guenter Roeck
2016-05-09 14:48     ` Guenter Roeck
2016-05-10 11:10     ` Joel Stanley
2016-05-10 11:10       ` Joel Stanley
2016-05-10 11:10       ` Joel Stanley
2016-05-10 13:25       ` Guenter Roeck [this message]
2016-05-10 13:25         ` Guenter Roeck
2016-05-10 13:25         ` Guenter Roeck
2016-05-12 14:17 ` [PATCH v2 0/2] " Joel Stanley
2016-05-12 14:17   ` Joel Stanley
2016-05-12 14:17   ` Joel Stanley
2016-05-12 14:17   ` [PATCH v2 1/2] doc/devicetree: Add Aspeed watchdog timer bindings Joel Stanley
2016-05-12 14:17     ` Joel Stanley
2016-06-23 13:46     ` [v2,1/2] " Guenter Roeck
2016-06-23 13:46       ` Guenter Roeck
2016-05-12 14:17   ` [PATCH v2 2/2] watchdog: Add Aspeed watchdog driver Joel Stanley
2016-05-12 14:17     ` Joel Stanley
2016-05-14 21:34     ` Guenter Roeck
2016-05-14 21:34       ` Guenter Roeck
2016-05-18  6:50       ` Joel Stanley
2016-05-18  6:50         ` Joel Stanley
2016-05-18  8:20   ` [PATCH v3 0/2] " Joel Stanley
2016-05-18  8:20     ` Joel Stanley
2016-05-18  8:20     ` [PATCH v3 1/2] doc/devicetree: Add Aspeed watchdog timer bindings Joel Stanley
2016-05-18  8:20       ` Joel Stanley
2016-05-30  8:07       ` Guenter Roeck
2016-05-30  8:07         ` Guenter Roeck
2016-05-18  8:21     ` [PATCH v3 2/2] watchdog: Add Aspeed watchdog driver Joel Stanley
2016-05-18  8:21       ` Joel Stanley
2016-05-30  8:08       ` Guenter Roeck
2016-05-30  8:08         ` Guenter Roeck
2016-07-17 19:49     ` [PATCH v3 0/2] " Wim Van Sebroeck

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=5731E135.8000100@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=arnd@arndb.de \
    --cc=benh@kernel.crashing.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jk@ozlabs.org \
    --cc=joel@jms.id.au \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=wim@iguana.be \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.