Skip to contentSkip to conversation

/dev/watchdog for onchip MPC860 watchdog?

DISCUSSION Graham Stoney 4 participants 6 messages Oct 19, 1999 – Oct 21, 1999 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 13 lines · Dan Malek
Quoted 5 lines · Graham Stoney

Dear Embeddees,

I'm wondering if anyone is working on a driver to provide the /dev/watchdog interface to the MPC860's on-chip watchdog?

The difficulty with the on-chip watchdog isn't the driver but the coordination with boot roms. The "auto-reset" features of the 8xx (watch dog, bus monitor, etc.) are part of a write once configuration register. Once disabled, they can't be enabled again until the processor is reset.

Quoted 4 lines

If the boot rom enables these features (especially the watch dog), you must service this as part of the Linux kernel processing. You can't wait around for some application at a later time to determine it now wants to enable and process the watchdog.

A couple of people mailed me off the list about my query, and as always, Dan's right -- it's nowhere near as simple as I first imagined. The watchdog can't be disabled/reenabled, and its maximum period is only a couple of seconds; there's no guarantee that the kernel will have booted and loaded the application by then, so the watchdog is likely to go off during the boot process. I think this probably puts my plans to use it on hold for now...

Thanks,
Graham

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#2 lore raw
Quoted 5 lines · Graham Stoney

.... The watchdog can't
be disabled/reenabled, and its maximum period is only a couple of seconds; there's no guarantee that the kernel will have booted and loaded the application by then, so the watchdog is likely to go off during the boot process. I think this probably puts my plans to use it on hold for now...

Maybe not. I was thinking about this (when I should have been doing other things :-) earlier today. What we could do when the internal watchdog is configured is to service it during the Linux timer interrupt when an application doesn't have it "enabled". This doesn't provide a watchdog service, just ensures it doesn't unexpectedly expire. When an application decides it wants the watchdog, we don't service it in the timer ISR.

We would have to litter the boot code with some service calls, like when you wait at the Linux boot prompt, and make sure you can uncompress and enable timer interrupts before the next expiration. Beyond that, we wouldn't have to look for any watchdog service points in the kernel.

I may play with it later tonight........

	-- Dan

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#3 lore raw

I've also been thinking about this...

If the boot process goes bad, then the interrupt driven watchdog will keep getting reset and prevent the watchdog from firing...leading to a unrecoverable hang. So, what's the likely hood of the boot process going bad?

Our application requires downloading new kernels and applications and this may
increase the likely hood that a kernel fails to complete the boot process.

This idea has a window of vunerability but how much and how likely???

Maybe the timer can be set longer than the longest bootup time or at least until the first daemon gets going?

jeff

----- Original Message -----
From: Dan Malek <[email protected]>
To: Graham Stoney <[email protected]>
Cc: Dan Malek <[email protected]>; <[email protected]>
Sent: Tuesday, October 19, 1999 3:51 PM
Subject: Re: /dev/watchdog for onchip MPC860 watchdog?

Quoted 6 lines
Quoted 2 lines · Graham Stoney

.... The watchdog can't
be disabled/reenabled, and its maximum period is only a couple of

seconds;

Quoted 3 lines
Quoted 3 lines

there's no guarantee that the kernel will have booted and loaded the application by then, so the watchdog is likely to go off during the boot process. I think this probably puts my plans to use it on hold for

now...

Quoted 15 lines

Maybe not. I was thinking about this (when I should have been doing other things :-) earlier today. What we could do when the internal watchdog is configured is to service it during the Linux timer interrupt when an application doesn't have it "enabled". This doesn't provide a watchdog service, just ensures it doesn't unexpectedly expire. When an application decides it wants the watchdog, we don't service it in the timer ISR.

We would have to litter the boot code with some service calls, like when you wait at the Linux boot prompt, and make sure you can uncompress and enable timer interrupts before the next expiration. Beyond that, we wouldn't have to look for any watchdog service points in the kernel.

Quoted 6 lines

I may play with it later tonight........

-- Dan

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#4 lore raw
Quoted 2 lines · Jeff Millar

If the boot process goes bad, then the interrupt driven watchdog will keep getting reset and prevent the watchdog from firing...

Yes....The alternative is finding all of the places in the kernel where you would have to service the watchdog during the boot process. Probably not many.....Depends upon the timeout value.

Quoted 2 lines

....... So, what's the likely hood of the boot process going bad?

My experience has been that unless the hardware is broken, it tends to either work every time or fail every time.

Quoted 3 lines

Our application requires downloading new kernels and applications and this may
increase the likely hood that a kernel fails to complete the boot process.

Yes, it will. But....what do you do after the new software load fails to boot? It will just keep resetting and running the same broken software......

Quoted 2 lines

Maybe the timer can be set longer than the longest bootup time or at least until the first daemon gets going?

All of the timeout and other controls are in the write-once SYPCR. Once you select the timeout and behavior, you have it until the next reset.

	-- Dan

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#5 lore raw
In reply to Jeff Millar
Quoted 8 lines

From: Dan Malek <[email protected]>
To: Graham Stoney <[email protected]>
Cc: Dan Malek <[email protected]>; <[email protected]>
Sent: Tuesday, October 19, 1999 3:51 PM
Subject: Re: /dev/watchdog for onchip MPC860 watchdog?

Quoted 22 lines
Quoted 3 lines
Quoted 2 lines · Graham Stoney

.... The watchdog can't
be disabled/reenabled, and its maximum period is only a couple of

seconds;

Quoted 3 lines
Quoted 3 lines

there's no guarantee that the kernel will have booted and loaded the application by then, so the watchdog is likely to go off during the boot process. I think this probably puts my plans to use it on hold for

now...

Quoted 14 lines

Maybe not. I was thinking about this (when I should have been doing other things :-) earlier today. What we could do when the internal watchdog is configured is to service it during the Linux timer interrupt when an application doesn't have it "enabled". This doesn't provide a watchdog service, just ensures it doesn't unexpectedly expire. When an application decides it wants the watchdog, we don't service it in the timer ISR.

We would have to litter the boot code with some service calls, like when you wait at the Linux boot prompt, and make sure you can uncompress and enable timer interrupts before the next expiration. Beyond that, we wouldn't have to look for any watchdog service points in the kernel.

Our email & file server died big time yesterday, so I only saw this this morning, and co-incidentally had exactly the same idea. To the user app, /dev/watchdog still looks much like the interface in watchdog.txt.

Sounds pretty good to me!

Thanks,
Graham

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#6 lore raw

I've added an arch-specific heartbeat as of 2.3 to the timer handler that could easily be setup to handle this.

I don't want the boot code 'littered' with calls to this, though. It'd be nice if the timer handler could take care of this until the user app could take it over. If the time between time_init() and the sti() is too great in start_kernel() that may not be possible.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/