Re: What to set in struct watchdog_device::bootstatus?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Guenter,

On Fri, Feb 08, 2019 at 06:05:43AM -0800, Guenter Roeck wrote:
> 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.

In a custom kernel patch stack I found a patch that uses (apart from
WDIOF_CARDRESET also) WDIOF_POWERUNDER and WDIOF_EXTERN1 to
differentiate the different reset causes. Now that you told using this
is wrong, I wonder how these are supposed to be used instead; and there
are a few more that according to
Documentation/watchdog/watchdog-kernel-api.txt might be used to set
bootstatus. Are these a relic? What do these signal?

IMHO there is a patch opportunity waiting to improve the documenation
:-) Or maybe even change watchdog_get_status() to ensure that only
WDIOF_CARDRESET, WDIOF_MAGICCLOSE and WDIOF_KEEPALIVEPING can be set?

Best regards
Uwe

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



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux