Linux-Watchdog Archive on lore.kernel.org
 help / color / Atom feed
From: Ken Sloat <KSloat@aampglobal.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: "Nicolas.Ferre@microchip.com" <Nicolas.Ferre@microchip.com>,
	"alexandre.belloni@free-electrons.com" 
	<alexandre.belloni@free-electrons.com>,
	"wim@iguana.be" <wim@iguana.be>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-watchdog@vger.kernel.org" <linux-watchdog@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Ken Sloat <KSloat@aampglobal.com>
Subject: RE: [RFE]: watchdog: atmel: atmel-sama5d4-wdt
Date: Mon, 10 Jun 2019 17:40:29 +0000
Message-ID: <BL0PR07MB4115CEC4D8CB4A9610E0EA78AD130@BL0PR07MB4115.namprd07.prod.outlook.com> (raw)
In-Reply-To: <20190610162811.GA11270@roeck-us.net>

> -----Original Message-----
> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
> Sent: Monday, June 10, 2019 12:28 PM
> To: Ken Sloat <KSloat@aampglobal.com>
> Cc: Nicolas.Ferre@microchip.com; alexandre.belloni@free-electrons.com;
> wim@iguana.be; linux-arm-kernel@lists.infradead.org; linux-
> watchdog@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [RFE]: watchdog: atmel: atmel-sama5d4-wdt
> 
> [This is an EXTERNAL EMAIL]
> ________________________________
> 
> On Mon, Jun 10, 2019 at 03:51:52PM +0000, Ken Sloat wrote:
> > Hello Nicolas,
> >
> > I wanted to open a discussion proposing new functionality to allow
> > disabling of the watchdog timer upon entering suspend in the SAMA5D2/4.
> >
> > Typical use case of a hardware watchdog timer in the kernel is a
> > userspace application opens the watchdog timer and periodically
> > "kicks" it. If the application hits a deadlock somewhere and is no
> > longer able to kick it, then the watchdog intervenes and often resets
> > the processor. Such is the case for the Atmel driver (which also
> > allows a watchdog interrupt to be asserted in lieu of a system reset). In
> most use cases, upon entering a low power/suspend state, the application
> will no longer be able to "kick" the watchdog. If the watchdog is not disabled
> or kicked via another method, then it will reset the system. This is the current
> behavior of the Atmel driver as of today.
> >
> > The watchdog peripheral itself does have a "WDIDLEHLT" bit however,
> > and this is enabled via the "atmel,idle-halt" dt property. However,
> > this is not very useful, as it literally only makes the watchdog count
> > when the CPU is active. This results in non-deterministic triggering
> > of the WDT and means that if a critical application were to crash, it
> > may be quite a long time before the WDT would ever trigger. Below is a
> > similar statement made in the device-tree doc for this
> > peripheral:
> >
> > - atmel,idle-halt: present if you want to stop the watchdog when the CPU is
> >                  in idle state.
> >       CAUTION: This property should be used with care, it actually makes the
> >       watchdog not counting when the CPU is in idle state, therefore the
> >       watchdog reset time depends on mean CPU usage and will not reset at
> all
> >       if the CPU stop working while it is in idle state, which is probably
> >       not what you want.
> >
> > It seems to me, that it would be logical and useful to introduce a new
> > property that would cause the Atmel WDT to disable on suspend and
> > re-enable on resume. It also appears that the WDT is re-initialized anyways
> upon resume, so the only piece missing here would really be a dt flag and a
> call to disable.
> >
Hello Guenter,

> Wondering - why would this need a dt property ? That would be quite
> unusual. Is there a condition where one would _not_ want the watchdog to
> stop on suspend ?

Good point, not sure there would be.

> If anything I would suggest to drop atmel,idle-halt completely; it really looks
> like it would make the watchdog unreliable.
> 
I agree, while it is a function of the SAMA5, it seems to me that it is not very 
useful in Linux, unless I am missing something. I will wait for Nicolas to chime 
in before I submit anything. I can certainly submit separate patches for each,
I already have something working for this.

> Thanks,
> Guenter

Thanks,
Ken Sloat

  reply index

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-10 15:51 Ken Sloat
2019-06-10 16:28 ` Guenter Roeck
2019-06-10 17:40   ` Ken Sloat [this message]
2019-06-10 20:13   ` Alexandre Belloni
2019-06-10 20:29     ` Guenter Roeck
2019-06-10 20:52       ` Ken Sloat

Reply instructions:

You may reply publically 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=BL0PR07MB4115CEC4D8CB4A9610E0EA78AD130@BL0PR07MB4115.namprd07.prod.outlook.com \
    --to=ksloat@aampglobal.com \
    --cc=Nicolas.Ferre@microchip.com \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --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

Linux-Watchdog Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-watchdog/0 linux-watchdog/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-watchdog linux-watchdog/ https://lore.kernel.org/linux-watchdog \
		linux-watchdog@vger.kernel.org linux-watchdog@archiver.kernel.org
	public-inbox-index linux-watchdog


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-watchdog


AGPL code for this site: git clone https://public-inbox.org/ public-inbox