2002-03-01 14:52:42

by Steve Hill

[permalink] [raw]
Subject: [Patch] ALi M7101 watchdog


Attached is a patch against the 2.4.17 tree to provide a /dev/watchdog
interface to the watchdog in the ALi M7101 PMU (as used in Cobalt's x86
kit - Raq3/4, Qube3, etc).

It takes notice of the CONFIG_WDT_NOWAYOUT option and will kick the
watchdog timer when the system goes down for a reboot so it pulls the
reset (as far as I can tell this is the only way to reboot Cobalt
machines?)

I have done preliminary testing on a Cobalt Raq 4 and it seems good -
please CC any comments / questions to me.

--

- Steve Hill
System Administrator Email: [email protected]
Navaho Technologies Ltd. Tel: +44-870-7034015

... Alcohol and calculus don't mix - Don't drink and derive! ...


Attachments:
linux-2.4.17-alim7101wdt.patch (11.12 kB)

2002-03-01 18:11:53

by Tim Hockin

[permalink] [raw]
Subject: Re: [Patch] ALi M7101 watchdog

> It takes notice of the CONFIG_WDT_NOWAYOUT option and will kick the
> watchdog timer when the system goes down for a reboot so it pulls the
> reset (as far as I can tell this is the only way to reboot Cobalt
> machines?)
>
> I have done preliminary testing on a Cobalt Raq 4 and it seems good -
> please CC any comments / questions to me.

The WDT in the 7101 is almost USELESS from user-space. It has a MAXIMUM 1
second timeout, and is tied straight to RESET. If you miss ONE feeding,
you reboot. In our kernel we have a 1/4 second timer to feed the watchdog,
and we still have to hack into some stuff to ensure that it gets met.
There are places where (drivers mostly) think it is OK to spin for multiple
seconds with interrupts off. If you put the responsibility for feeding the
WDT into user-space, I'll bet dollars to dimes you'll start experiencing
random reboots. If I was allowed to, I would have used the WDT for reboot
ONLY, and had it off otherwise - it is WAAAAY finicky.

Tim

2002-03-04 09:09:12

by Steve Hill

[permalink] [raw]
Subject: Re: [Patch] ALi M7101 watchdog

On Fri, 1 Mar 2002, Tim Hockin wrote:

> The WDT in the 7101 is almost USELESS from user-space. It has a MAXIMUM 1
> second timeout, and is tied straight to RESET. If you miss ONE feeding,
> you reboot. In our kernel we have a 1/4 second timer to feed the watchdog,

If you look at the code you will see that I am refreshing the watchdog as
1/4 second intervals - the userspace watchdog is handled in software so
that if it does not get a heartbeat every 30 seconds then the driver stops
sending the automated 1/4 second heartbeats to the hardware.

We've been using a similar (very hacked about) watchdog for about a year
without any problems but I have only just gotten around to neatening it
up.

> random reboots. If I was allowed to, I would have used the WDT for reboot
> ONLY, and had it off otherwise - it is WAAAAY finicky.

Under this patch, if you don't open /dev/watchdog then the watchdog is
only ever activated for reboots.

--

- Steve Hill
System Administrator Email: [email protected]
Navaho Technologies Ltd. Tel: +44-870-7034015

... Alcohol and calculus don't mix - Don't drink and derive! ...