From: Wim Van Sebroeck Hi Linus, Andrew, please do a bk pull http://linux-watchdog.bkbits.net/linux-2.6-watchdog This will update the following files: through these ChangeSets: (04/06/12 1.1755) [WATCHDOG] v2.6.6 pcwd.c-keepalive+single_open-patch - Make pcwd_keepalive return 0 on success. - /dev/watchdog is single open only: make sure that the atomic that prevents a second open is cleared only as the last instruction of the release code. (04/06/12 1.1756) [WATCHDOG] pcwd_pci.c-single_open+set_heartbeat+init-patch - /dev/watchdog is single open only: make sure that the bit that prevents a second open is cleared as the last instruction of the release code - Change the way we set the original heartbeat - Make sure that /dev/temperature get's registered before /dev/watchdog (04/06/12 1.1757) [WATCHDOG] pcwd_usb.c-single_open+set_heartbeat+init-patch - /dev/watchdog is single open only: make sure that the bit that prevents a second open is cleared as the last instruction of the release code - Change the way we set the original heartbeat code - Make sure that /dev/temperature get's registered before /dev/watchdog The ChangeSets can also be looked at on: http://linux-watchdog.bkbits.net:8080/linux-2.6-watchdog Signed-off-by: Andrew Morton --- 25-akpm/drivers/char/watchdog/pcwd.c | 7 +++--- 25-akpm/drivers/char/watchdog/pcwd_pci.c | 36 ++++++++++++++----------------- 25-akpm/drivers/char/watchdog/pcwd_usb.c | 28 +++++++++++------------- 3 files changed, 34 insertions(+), 37 deletions(-) diff -puN drivers/char/watchdog/pcwd.c~pcwdc-patches drivers/char/watchdog/pcwd.c --- 25/drivers/char/watchdog/pcwd.c~pcwdc-patches 2004-06-13 21:05:48.475395416 -0700 +++ 25-akpm/drivers/char/watchdog/pcwd.c 2004-06-13 21:05:48.483394200 -0700 @@ -70,7 +70,7 @@ #include #include -#define WD_VER "1.16 (03/27/2004)" +#define WD_VER "1.16 (06/12/2004)" #define PFX "pcwd: " /* @@ -299,10 +299,11 @@ static int pcwd_stop(void) return 0; } -static void pcwd_keepalive(void) +static int pcwd_keepalive(void) { /* user land ping */ next_heartbeat = jiffies + (heartbeat * HZ); + return 0; } static int pcwd_set_heartbeat(int t) @@ -529,12 +530,12 @@ static int pcwd_close(struct inode *inod { if (expect_close == 42) { pcwd_stop(); - atomic_inc( &open_allowed ); } else { printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n"); pcwd_keepalive(); } expect_close = 0; + atomic_inc( &open_allowed ); return 0; } diff -puN drivers/char/watchdog/pcwd_pci.c~pcwdc-patches drivers/char/watchdog/pcwd_pci.c --- 25/drivers/char/watchdog/pcwd_pci.c~pcwdc-patches 2004-06-13 21:05:48.477395112 -0700 +++ 25-akpm/drivers/char/watchdog/pcwd_pci.c 2004-06-13 21:05:48.484394048 -0700 @@ -49,7 +49,7 @@ /* Module and version information */ #define WATCHDOG_VERSION "1.00" -#define WATCHDOG_DATE "13/03/2004" +#define WATCHDOG_DATE "12 Jun 2004" #define WATCHDOG_DRIVER_NAME "PCI-PC Watchdog" #define WATCHDOG_NAME "pcwd_pci" #define PFX WATCHDOG_NAME ": " @@ -73,7 +73,7 @@ #define WD_PCI_TTRP 0x04 /* Temperature Trip status */ /* according to documentation max. time to process a command for the pci - watchdog card is 100 ms, so we give it 150 ms to do it's job */ + * watchdog card is 100 ms, so we give it 150 ms to do it's job */ #define PCI_COMMAND_TIMEOUT 150 /* Watchdog's internal commands */ @@ -404,8 +404,8 @@ static int pcipcwd_release(struct inode printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n"); pcipcwd_keepalive(); } - clear_bit(0, &is_active); expect_release = 0; + clear_bit(0, &is_active); return 0; } @@ -585,15 +585,12 @@ static int __devinit pcipcwd_card_init(s printk(KERN_INFO PFX "No previous trip detected - Cold boot or reset\n"); /* Check that the heartbeat value is within it's range ; if not reset to the default */ - if (heartbeat < 1 || heartbeat > 0xFFFF) { - heartbeat = WATCHDOG_HEARTBEAT; + if (pcipcwd_set_heartbeat(heartbeat)) { + pcipcwd_set_heartbeat(WATCHDOG_HEARTBEAT); printk(KERN_INFO PFX "heartbeat value must be 0" #define DRIVER_DESC "Berkshire USB-PC Watchdog driver" #define DRIVER_LICENSE "GPL" @@ -456,8 +457,8 @@ static int usb_pcwd_release(struct inode printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n"); usb_pcwd_keepalive(usb_pcwd_device); } - clear_bit(0, &is_active); expect_release = 0; + clear_bit(0, &is_active); return 0; } @@ -681,15 +682,12 @@ static int usb_pcwd_probe(struct usb_int ((option_switches & 0x08) ? "ON" : "OFF")); /* Check that the heartbeat value is within it's range ; if not reset to the default */ - if (heartbeat < 1 || heartbeat > 0xFFFF) { - heartbeat = WATCHDOG_HEARTBEAT; + if (usb_pcwd_set_heartbeat(usb_pcwd, heartbeat)) { + usb_pcwd_set_heartbeat(usb_pcwd, WATCHDOG_HEARTBEAT); printk(KERN_INFO PFX "heartbeat value must be 0exists = 0; /* Deregister */ - misc_deregister(&usb_pcwd_temperature_miscdev); misc_deregister(&usb_pcwd_miscdev); + misc_deregister(&usb_pcwd_temperature_miscdev); unregister_reboot_notifier(&usb_pcwd_notifier); up (&usb_pcwd->sem); @@ -791,7 +789,7 @@ static int __init usb_pcwd_init(void) return result; } - printk(KERN_INFO PFX DRIVER_DESC " " DRIVER_VERSION "\n"); + printk(KERN_INFO PFX DRIVER_DESC " v" DRIVER_VERSION " (" DRIVER_DATE ")\n"); return 0; } _