devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Isaac True <isaac.true@canonical.com>
Cc: Guenter Roeck <linux@roeck-us.net>,
	linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org,
	wim@linux-watchdog.org
Subject: Re: [PATCH 2/2] watchdog: gpio: add configurable minimum interval
Date: Tue, 5 Jul 2022 13:56:14 -0600	[thread overview]
Message-ID: <20220705195614.GA2503171-robh@kernel.org> (raw)
In-Reply-To: <CALkPoPYKNxAeP6HM1cMh1zzW6jw4fktCp42b7+79Qf8DVJis-w@mail.gmail.com>

On Mon, Jul 04, 2022 at 01:05:04PM +0200, Isaac True wrote:
> On Fri, 1 Jul 2022 at 19:48, Guenter Roeck <linux@roeck-us.net> wrote:
> >
> > On 7/1/22 10:18, Rob Herring wrote:
> > > On Wed, Jun 29, 2022 at 01:06:26PM +0200, Isaac True wrote:
> > >> Add the "min_hw_margin_ms" parameter to gpio_wdt devices, allowing a
> > >> minimum interval to be specified, stopping watchdog devices from being
> > >> fed too quickly if they require a certain interval between feeds.
> > >
> > > I assume there is some real platform with a real problem you are trying
> > > to solve? Details please.
> > >
> >
> > Agreed, this should be explained in more detail.
> 
> Yes this is a real platform using a TI TPS3850 watchdog chip. With
> this chip you can configure a "window" which can detect early faults
> (i.e. too frequent) in addition to the standard watchdog features. I
> needed to add this minimum timeout to avoid watchdog resets in
> situations such as where first U-Boot and then the Linux kernel feed
> the watchdog with too short of an interval between them, or when
> systemd was configured to use the watchdog device and was feeding it
> too soon after taking over from the kernel.
> 
> > > Can you just hardcode some min? Maybe 10% of the max or something. Is
> > > there a downside to a larger than necessary min?
> > >
> >
> > That would result in extra overhead in the watchdog core which would not
> > be required for all other hardware using this driver. I'd rather avoid that.
> >
> 
> In the case of the TI TPS3850, the minimum timeout is configurable, so
> I didn't want to add a hard-coded value to the driver.
> 
> > > Wouldn't be better to fix this without requiring a DT change and that
> > > could work on stable kernels if needed.
> > >
> >
> > Presumably that is some new hardware. Most of the watchdog drivers
> > needing this value can derive it from the compatible property. The
> > gpio watchdog driver is a bit different since it is supposed to work
> > on a variety of hardware using gpio pins for watchdog control.
> >
> 
> Yes this is new hardware. This use case is also not very common as
> most watchdog chips don't have this window function or a minimum
> interval, at least in my experience, so I did not want to make it the
> default for everything.

Okay. However the existing property you copied has 2 problems. It uses 
underscores rather than hypens and doesn't use a standard unit suffix. 
So 'min-hw-margin-ms'.

Though maybe a new property instead:

timeout-range-ms = <min max>;

That's somewhat aligned to 'timeout-sec', and IMO, clearer meaning than 
'hw margin'.

Rob

  reply	other threads:[~2022-07-05 19:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-29 11:06 [PATCH 1/2] dt-bindings: watchdog: gpio: add minimum interval Isaac True
2022-06-29 11:06 ` [PATCH 2/2] watchdog: gpio: add configurable " Isaac True
2022-07-01 17:18   ` Rob Herring
2022-07-01 17:48     ` Guenter Roeck
2022-07-04 11:05       ` Isaac True
2022-07-05 19:56         ` Rob Herring [this message]
2022-07-07  9:00           ` Isaac True
2022-07-08 11:44             ` Guenter Roeck
2022-07-12 21:04               ` Rob Herring

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=20220705195614.GA2503171-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=isaac.true@canonical.com \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --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).