谁是令人耳目一新的Linux硬件看门狗? [英] Who is refreshing hardware watchdog in Linux?

查看:553
本文介绍了谁是令人耳目一新的Linux硬件看门狗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个处理器运行AT91SAM9G20 2.6内核。看门狗在引导级别启用和配置为16秒。看门狗模式寄存器只能配置一次。
当code的引导,引导程序或内核,主板重启挂起无论是。但是,一旦内核上来即使看门狗未在任何应用程序的更新,董事会不为16秒,但15分钟后复位。

I have a processor AT91SAM9G20 running a 2.6 kernel. Watchdog is enabled at bootstrap level and configured for 16 seconds. Watchdog mode register can be configured only once. When code hangs either in bootstrap, bootloader or kernel, the board reboots. But once kernel comes up even though watchdog is not refreshed in any of the applications, the board is not being reset after 16 seconds, but 15 minutes.

谁刷新看门狗?

在我们的例子中,看门狗应该由应用程序的影响,从而使电路板可以,如果我们的应用程序挂起复位。

In our case, the watchdog should be influenced by applications, so that the board can reset if our application hangs.

这是正在运行的进程:

1 root     init
2 root     [kthreadd]
3 root     [ksoftirqd/0]
4 root     [watchdog/0]
5 root     [events/0]
6 root     [khelper]
63 root     [kblockd/0]
72 root     [ksuspend_usbd]
78 root     [khubd]
85 root     [kmmcd]
107 root     [pdflush]
108 root     [pdflush]
109 root     [kswapd0]
110 root     [aio/0]
740 root     [mtdblockd]
828 root     [rpciod/0]
982 root     [jffs2_gcd_mtd10]
1003 root     /sbin/udevd -d
1145 daemon   portmap
1158 dbus     dbus-daemon --system
1178 root     /usr/sbin/ifplugd -i eth0 -fwI -u0 -d5 -l -q
1190 root     /usr/sbin/ifplugd -i eth1 -fwI -u0 -d5 -l -q
1221 default  avahi-daemon: running [SP14.local]
1226 root     /usr/sbin/dropbear
1246 root     /root/bin/host_app
1254 root     /root/bin/mini_httpd -c *.cgi -d /root/bin -u root -E /root/bin/
1256 root     -sh
1257 root     /sbin/syslogd -n -m 0
1258 root     /sbin/klogd -n
1259 root     /usr/bin/tail -f /var/log/messages
1265 root     ps -e

我们正在使用的看门狗在内核2.6.25-ts.at91sam9g20可用柔软的禁售/内核/ softlockup.c

We are using the watchdog for soft lockups available in kernel-2.6.25-ts.at91sam9g20/kernel/softlockup.c

推荐答案

如果您启用了内核看门狗驱动程序,驱动程序看门狗设置一个计时器内核,负责重置看门狗。相应的code是这里。因此,它的工作原理是这样的:

If you enabled the watchdog driver in your kernel, the watchdog driver sets up a kernel timer, in charge of resetting the watchdog. The corresponding code is here. So it works like this:

如果没有应用程序打开/ dev /看门狗文件,那么内核需要重置看门狗的照顾。因为它是一个计时器,它不会出现作为专用内核线程,而是由软的IRQ线处理。现在,如果一个应用程序打开这个文件,就成了负责监督,并可以通过写入文件,在理查德的职位挂钩的文档如记录重置。

If no application opens the /dev/watchdog file, then the kernel takes care of resetting the watchdog. Since it is a timer, it won't appear as a dedicated kernel thread, but handled by the soft IRQ thread. Now, if an application opens this file, it becomes responsible of the watchdog, and can reset it by writing to the file, as documented by the documentation linked in Richard's post.

在你的内核配置看门狗驱动程序?
如果没有,你应该配置它,看看是否复位仍然发生。如果它仍然发生,很可能你的复位来自别的地方。

Is the watchdog driver configured in your kernel? If not, you should configure it, and see if the reset still happens. If it still happens, it is likely that your reset comes from somewhere else.

如果你的内核是太老了,有一个正确的看门狗驱动程序(在2.6.25没有present),你应该从2.6.28反向移植了。或者你可以尝试在你的引导,禁止看门狗,看看复位仍然出现。

If your kernel is too old to have a proper watchdog driver (not present in 2.6.25) you should backport it from 2.6.28. Or you can try to disable the watchdog in your bootloader and see if the reset still occurs.

这篇关于谁是令人耳目一新的Linux硬件看门狗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆