/dev/watchdog for onchip MPC860 watchdog?
Hi Raphael
I'm interested in the application you mentioned in your message:
http://lists.linuxppc.org/listarcs/linuxppc-embedded/199910/msg00028.html
Quoted 9 lines
I'm using the watchdog timer on a custom board since several months. To
prevent a CPU reset during the kernel is uncompressing, i prorammed it to generate a Non Maskable Interrupt instead of system reset. Those NMIs
are handled by a special function in the Linux kernel. This function can reset the board, using a specific I/O, when too many NMIs occurred without any watchdog timer (SWSR) servicing.
Quoted 6 lines
Today, i refresh the timer in my real time application that is launched
immediately after the kernel init. This scheme must work for any board launching an appli/real time module after kernel init. For other configurations,
Dan's idea seems perfect.
I'm trying to find a way to use the on chip watchdog to provide an automatic reboot should the software on our custom board go to never never land. At the moment I don't need to provide the /dev/watchdog interface, but I may in the future. Dan's idea about not servicing the SWSR while /dev/watchdog is open sounds good for that. But for now, I just need a way to keep the watchdog timer from expiring as long as things are working "normally". I like the idea of using an application to write to the SWSR rather than doing it from the timer interrupt in the kernel because I can envision cases where interrupts but not much else may be working.
But I don't know how to guarantee that the application will be able to service the watchdog in any given interval of time. How do you distinguish between the case where the system has stopped working and the case where the system is busy but still functioning?
Any help you can give would be appreciated. If anyone else has an opinion as to the best place to service the watchdog in order to provide protection from a hung system, I'd love to hear it.
Thanks
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Quoted 4 lines · Tania Boak
But I don't know how to guarantee that the application will be able to service the watchdog in any given interval of time. How do you distinguish between the case where the system has stopped working and the case where the system is busy but still functioning?
Your system needs to have some periodic task which you can guarantee will run sufficiently often during normal operation, and hopefully will clag if something catastrophic happens. If you're doing simple regular data aquisition, that's reasonably easy, but if it's a more complex system, there may not be such a periodic task. In this case you can run a real-time thread at high priority which sleeps most of the time, just to tickle the watchdog; but it still won't guarantee that the lower priority threads are running OK. Still, some protection may be better than none, depending on your application.
Regards,
Graham
--
Graham Stoney
Principal Hardware/Software Engineer
Canon Information Systems Research Australia
Ph: +61 2 9805 2909 Fax: +61 2 9805 2929
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/