Linux-Watchdog Archive on lore.kernel.org
 help / Atom feed
* What to set in struct watchdog_device::bootstatus?
@ 2019-02-08 10:52 Uwe Kleine-König
  2019-02-08 14:05 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Uwe Kleine-König @ 2019-02-08 10:52 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck; +Cc: linux-watchdog

Hello,

it's unclear to me, which bits I am supposed to set in the bootstatus
member of struct watchdog_device at probe time.

The i.MX watchdog differentiates the following reset causes:

 - Power On
 - external reset
 - watchdog timeout
 - software reset using a bit in the watchdog register set

(Not all i.MX variants implement all bits according to the respective
reference manuals.)

Should "Power On" result in setting WDIOF_POWERUNDER?

Should "software reset [...]" result in WDIOF_CARDRESET?

Should "external reset" result in WDIOF_EXTERN1? (I guess that no)

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: What to set in struct watchdog_device::bootstatus?
  2019-02-08 10:52 What to set in struct watchdog_device::bootstatus? Uwe Kleine-König
@ 2019-02-08 14:05 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2019-02-08 14:05 UTC (permalink / raw)
  To: Uwe Kleine-König, Wim Van Sebroeck; +Cc: linux-watchdog

On 2/8/19 2:52 AM, Uwe Kleine-König wrote:
> Hello,
> 
> it's unclear to me, which bits I am supposed to set in the bootstatus
> member of struct watchdog_device at probe time.
> 
> The i.MX watchdog differentiates the following reset causes:
> 
>   - Power On
None.

>   - external reset

None.

>   - watchdog timeout

WDIOF_CARDRESET

>   - software reset using a bit in the watchdog register set
> 
> (Not all i.MX variants implement all bits according to the respective
> reference manuals.)
> 
> Should "Power On" result in setting WDIOF_POWERUNDER?
> 
No.

> Should "software reset [...]" result in WDIOF_CARDRESET?
> 
That would be the best fit if you want a bit to be set, but it would be
misleading since it would suggest that the watchdog fired.

> Should "external reset" result in WDIOF_EXTERN1? (I guess that no)
> 
No.

Overall, the bits are only to be set if the reset was triggered by
the watchdog controller.

Guenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-08 10:52 What to set in struct watchdog_device::bootstatus? Uwe Kleine-König
2019-02-08 14:05 ` Guenter Roeck

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