public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Andreas Werner <andy@wernerandy.de>
Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: Window watchdog driver design
Date: Thu, 14 May 2015 17:52:38 -0700	[thread overview]
Message-ID: <55554356.3070700@roeck-us.net> (raw)
In-Reply-To: <20150514140908.GA21645@wernerandy.de>

On 05/14/2015 07:09 AM, Andreas Werner wrote:
> On Thu, May 14, 2015 at 06:30:05AM -0700, Guenter Roeck wrote:
>> On 05/14/2015 04:56 AM, Andreas Werner wrote:
>>> Hi,
>>> in the next few weeks I need to write a driver for a window wachtdog
>>> implemented in a CPLD. I have some questions about the design
>>> of the driver and the best way to write this driver to also be able
>>> to submit it.
>>>
>>> The triggering and configuration of the Watchdog is done by several GPIOs which
>>> are connected to the CPLD watchdog device. The correct GPIOs are configurable
>>> using the Device Tree.
>>>
>>> 1. Timeout
>>> 	The timeout values are defined in ms and start from 20ms to 2560ms.
>>> 	The timout is set by 3 GPIOs this means we have only 8 different
>>> 	timout values. It is also possible that a future Watchdog CPLD device
>>> 	does have different timeout values.
>>>
>>> 	Is it possible to set ms timeouts? It seems that the WDT API does
>>> 	only support a resolution of 1sec.
>>>
>>> 	One idea would be to use the API timeout as something like a timeout
>>> 	index to set the different values. Of course this needs to be documented.
>>>
>>> 	e.g.
>>> 	timeout	(API)	timeout in device
>>> 	1 		20ms
>>> 	2		100ms
>>> 	3		500ms
>>> 	...		...		
>>>
>>> 2. Upper/Lower Window
>>> 	There is currently no support for a windowed watchdog in the wdt core.
>>> 	The lower window can be activated by a gpio and its timeout is defined
>>> 	as "upper windows timeout/4"	
>>>
>>> 	What is the best way to implement those additional settings? Adding additional
>>> 	ioctl or export these in sysfs?
>>> --
>>
>> Sorry for the maybe dumb question, but what is a window watchdog,
>> and what is the lower window timeout for (assuming the upper window
>> timeout causes the watchdog to expire) ?
>>
>> Guenter
>>
>
> Oh sorry forgot to describe it in more detail.
>
> If you have a watchdog window you do not have just one timeout where the watchdog can expire.
> You have a so called "window" to trigger it within.
>
> 		|<----trig---->|
> ---lower timeout----------------upper timeout
>
> This means you have to trigger the watchdog not to late and not to early.
> This kind of watchdog is often used in embedded applications or more often
> in safety cases to fullfil requirements given e.g. by SIL1-SIL4 certifications.
>
> The lower timeout is set by a dedicated GPIO and the value will then "Upper timeout / 4". The
> upper timeout is set by 3 GPIOs to get different timeout values.
>

Thanks a lot for the explanation.

I would suggest to use a module parameter to enable the "lower timeout" functionality.

Timeouts have to be specified in seconds.

Hope this helps,
Guenter


  reply	other threads:[~2015-05-15  0:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-14 11:56 Window watchdog driver design Andreas Werner
2015-05-14 13:30 ` Guenter Roeck
2015-05-14 14:09   ` Andreas Werner
2015-05-15  0:52     ` Guenter Roeck [this message]
2015-05-15  5:43       ` Andreas Werner
2015-05-15  6:14         ` Guenter Roeck
2015-05-15 17:17           ` Andreas Werner
2015-05-15 17:52           ` Andreas Werner
2015-05-15  6:26         ` Timo Kokkonen

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=55554356.3070700@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=andy@wernerandy.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.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