Linux Renesas SOC kernel development
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Wolfram Sang <wsa@the-dreams.de>
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>,
	linux-watchdog@vger.kernel.org,
	linux-renesas-soc@vger.kernel.org,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Subject: Re: [PATCH] watchdog: renesas_wdt: adapt timer setup to recommended procedure
Date: Tue, 27 Feb 2018 07:03:29 -0800	[thread overview]
Message-ID: <86da4e12-0d0c-c07a-eecd-76466f713da1@roeck-us.net> (raw)
In-Reply-To: <20180227130058.pmgo33zjvbxwmlad@ninjato>

On 02/27/2018 05:00 AM, Wolfram Sang wrote:
>>> -	rwdt_write(priv, 0, RWTCSRB);
>>> -	rwdt_write(priv, priv->cks, RWTCSRA);
>>
>> Isn't this done implicitly with the above already ?
>> After all, priv->cks won't have RWTCSRA_TME set.
> 
> Yes. The request came from a group doing some (safety?) audit who didn't
> like the implicit handling which might change if the code in probe()
> might change somewhen. And the datasheet explicitly says to disable the
> timer first before doing anything with the clock dividers. Given that, I
> can agree to this change, too.
> 

Defensive code is fine, bit that is a bit too defensive. We might as well
start checking value ranges in the drivers' set_timeout functions just in case
the core gets it wrong. Just add a note to the probe function where cks is
initialized that RWTCSRA_TME must not be set, and that RWTCSRA_TME must be
cleared before changing the divider.

Guenter

  reply	other threads:[~2018-02-27 15:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-26 21:49 [PATCH] watchdog: renesas_wdt: adapt timer setup to recommended procedure Wolfram Sang
2018-02-26 22:38 ` Guenter Roeck
2018-02-27 13:00   ` Wolfram Sang
2018-02-27 15:03     ` Guenter Roeck [this message]
2018-02-27 16:22       ` Wolfram Sang
2018-02-27 17:19         ` Guenter Roeck
2018-02-27 20:36           ` Wolfram Sang

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=86da4e12-0d0c-c07a-eecd-76466f713da1@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=fabrizio.castro@bp.renesas.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=wsa+renesas@sang-engineering.com \
    --cc=wsa@the-dreams.de \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    /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