Forums » Software Development »
watchdog causes strange side effects
Added by stephan berner about 11 years ago
Hi,
I am having a lot of problems with the watchdog.
1) After kicking it for several minutes, a kernel panic occurs because the NTP deamon (ntpd) hangs
ntpd D c026f624 0 1370 1 0x00000001
[<c026f624>] (schedule+0x2a8/0x334) from [<c027023c>] (_mutex_lock_slowpath+0x98/0x118)
[<c027023c>] (_mutex_lock_slowpath+0x98/0x118) from [<c01c4c20>] (dev_ioctl+0x24/0x6bc)
[<c01c4c20>] (dev_ioctl+0x24/0x6bc) from [<c00a153c>] (vfs_ioctl+0x2c/0xac)
[<c00a153c>] (vfs_ioctl+0x2c/0xac) from [<c00a1bf4>] (do_vfs_ioctl+0x548/0x5a0)
[<c00a1bf4>] (do_vfs_ioctl+0x548/0x5a0) from [<c00a1c80>] (sys_ioctl+0x34/0x54)
[<c00a1c80>] (sys_ioctl+0x34/0x54) from [<c002bea0>] (ret_fast_syscall+0x0/0x28)
Kernel panic - not syncing: hung_task: blocked tasks
[<c003069c>] (unwind_backtrace+0x0/0xd0) from [<c026f1c4>] (panic+0x44/0xc8)
[<c026f1c4>] (panic+0x44/0xc8) from [<c006aab0>] (watchdog+0x1d4/0x21c)
[<c006aab0>] (watchdog+0x1d4/0x21c) from [<c00546a4>] (kthread+0x78/0x80)
[<c00546a4>] (kthread+0x78/0x80) from [<c002c8dc>] (kernel_thread_exit+0x0/0x8)
2) When I run the system without ntpd, after a few minutes all file operations in
my main program stop (blocking forever). The watchdog is kicked in another process.
I suspect that these problems occur because a clock is turned on for the watchdog as I see in the
driver code (omap_wdt.c),
clk_enable(wdev->ick)
clk_enable(wdev->fck)
Any ideas ?
SB
Replies (5)
RE: watchdog causes strange side effects - Added by Michael Williamson about 11 years ago
None come to mind right away....
What model number SOM are you using?
What version of the kernel are you using, and can you attach your /proc/config.gz file?
Also, do you have a simple application that reproduces the issue that you'd be willing to share?
I believe we have other folks using the watchdog without issue, so I'm not certain exactly what is going on.
-Mike
RE: watchdog causes strange side effects - Added by Michael Williamson about 11 years ago
Is it possible the watchdog is firing before you kick it? How much margin do you have between the kick and the configured timeout?
-Mike
RE: watchdog causes strange side effects - Added by stephan berner about 11 years ago
Thanks for the fast reply !
Model #:L138-FI-381RL-3B
/proc/config.gz attached
Further debugging revealed that the communication between ARM and DSP stops as soon as I start kicking the watchdog. The DSP is still alive, but it appears that it stops serving the shared memory buffer (at addr 0x80000000). The DSP application code does not use any timers which might interfere with the watchdog timer. DSP OS is dspbios
No, the watchdog does not fire prematurely. I kick it every second and I didn't change the timeout value. If I stop kicking it, I see that it fires after one minute as it is supposed to do.
RE: watchdog causes strange side effects - Added by stephan berner about 11 years ago
Got some more insight. When I start kicking the watchdog, the dspbios function TSK_sleep() fails (sleeps forever). It seems that dspbios relies on the same timer as the watchdog. How can I select which timer is used by dspbios and linux ?
RE: watchdog causes strange side effects - Added by Michael Williamson about 11 years ago
Ah, OK.
There is a post on TI's E2E site that talks about this exact issue. The post also includes some example code to have the DSP use Timer 2 or Timer 3 instead of timer 0 (used by linux scheduler) and timer 1 (used by watchdog).
Hope this helps.
-Mike