hpwdt HP WatchDog Patch <resend>
Hp is providing a Hardware WatchDog Timer driver that will only work with the specific HW Timer located in the HP ProLiant iLO 2 ASIC. The iLO 2 HW Timer will generate a Non-maskable Interrupt (NMI) 9 seconds before physically resetting the server, by removing power, so that the event can be logged to the HP Integrated Management Log (IML), a Non-Volatile Random Access Memory (NVRAM). The logging of the event is performed using the HP ProLiant ROM via an Industry Standard access known as a BIOS Service Directory Entry.
drivers/char/watchdog/Makefile renamed from drivers/char/watchdog/Makefile.orig +2 -0
@@ -79,6 +79,8 @@ obj-$(CONFIG_W83977F_WDT) += w83977f_wdt.o obj-$(CONFIG_MACHZ_WDT) += machzwd.o obj-$(CONFIG_SBC_EPX_C3_WATCHDOG) += sbc_epx_c3.o +CFLAGS_hpwdt.o += -O +obj-$(CONFIG_HP_WATCHDOG) += hpwdt.o # M32R Architecture
drivers/char/watchdog/Kconfig renamed from drivers/char/watchdog/Kconfig.orig +12 -0
@@ -575,6 +575,18 @@ To compile this driver as a module, choose M here: the module will be called sbc_epx_c3. +config HP_WATCHDOG + tristate "Hewlett-Packard watchdog" + depends on X86 + help + A software monitoring watchdog and NMI sourcing driver. This driver + will detect lockups and provide stack trace. Also, when an NMI + occurs this driver will make the necessary BIOS calls to log + the cause of the NMI. This is a driver that will only load on a + HP ProLiant system with a minimum of iLO2 support. + To compile this driver as a module, choose M here: the + module will be called hpwdt. + # M32R Architecture # M68K Architecture
drivers/char/watchdog/hpwdt.c renamed from drivers/char/watchdog/hpwdt.c.orig +878 -0
879 lines not on this page · raw message
Hi Thomas,
I reviewed yor code and have ome remarks:
* All watchdog device drivers should work with seconds. Your driver works with minutes. Please change to seconds.
* The misc_register function (which opens your driver towards user-space) should be the last iregister-action you take into the pci probe function. (So just before you do the printk where you say that the driver has been initialized).
* The open and release functions should make sure that /dev/watchdog can only be opened once.
* /dev/watchdog is a VFS (Virtual File System) so your open function should return with "return nonseekable_open(inode, file);".
* please put the code to start the watchdog in a seperate function (this will make it easier to migrate your driver to the generic watchdog model in the future).
* If you watchdog can't be stopped then you should use a timer to make sure that when /dev/watchdog is closed, that you continue to keepalive/ping the watchdog device. (please see mixcomwd.c (this device has the same problem)).
* please put the code to change the timeout in a seperate function.
* the default return value for the ioctl calls should be -ENOTTY (instead of -ENOIOCTLCMD).
* the GETSTATUS call should also have a "put_user(0, (int *)arg);".
* if possible please add sparse testing code into the ioctl handling.
* Personnaly: I would rather see the generic smbios code somewhere in the arch/x86/ directory. We will probably need that also in other (non-watchdog) drivers in the future.
Greetings,
Wim.