Skip to contentSkip to conversation

v2.6.31-rc patches - Part 4: fixes and small changes

WATCHDOG Wim Van Sebroeck 1 participant 1 message Jul 9, 2009 Watchdog device drivers

lore
Share & tools
lore
#0 lore raw

Hi Linus,

Please pull from 'master' branch of
git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog.git
or if master.kernel.org hasn't synced up yet:
master.kernel.org:/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog.git

This will update the following files:

 drivers/watchdog/bcm47xx_wdt.c  |    2 +-
 drivers/watchdog/sa1100_wdt.c   |    5 +++--
 drivers/watchdog/w83627hf_wdt.c |    5 +++++
 drivers/watchdog/w83697ug_wdt.c |    4 +++-
 4 files changed, 12 insertions(+), 4 deletions(-)

with these Changes:

Author: Slobodan Tomić <[email protected]>
Date:   Sun Jun 28 21:20:36 2009 +0200

[WATCHDOG] w83627hf_wdt.c: add support for the W83627EHF support

Add support for the W83627EHF/EF and W83627EHG/EG chipsets.

Author: Raphael Assenat <[email protected]>
Date:   Mon Jun 29 13:56:52 2009 -0400

[WATCHDOG] SA1100 watchdog maximum timeout

This patch replaces the hardcoded 255 seconds limit for a real limit based on oscr_freq.

Also, the 'firmware_version' field is changed to '1' to allow the user space application to easily detect that this driver supports a higher maximum timeout.

Author: Jiri Slaby <[email protected]>
Date:   Mon Jun 29 18:00:39 2009 +0200

[WATCHDOG] w83697ug, fix lock imbalance

Don't forget to unlock io_lock when w83697ug_select_wd_register fails in wdt_ctrl.

Author: Joe Perches <[email protected]>
Date:   Sun Jun 28 09:26:57 2009 -0700

[WATCHDOG] drivers/watchdog/bcm47xx_wdt.c: Remove unnecessary semicolons

The Changes can also be looked at on:

	http://www.kernel.org/git/?p=linux/kernel/git/wim/linux-2.6-watchdog.git;a=summary

For completeness, I added the overal diff below.

Greetings,
Wim.

================================================================================

drivers/watchdog/bcm47xx_wdt.c +1 -1
index 5c7011c..751c003 100644
@@ -161,7 +161,7 @@ static long bcm47xx_wdt_ioctl(struct file *file,
 {
 	void __user *argp = (void __user *)arg;
 	int __user *p = argp;
-	int new_value, retval = -EINVAL;;
+	int new_value, retval = -EINVAL;
 
 	switch (cmd) {
 	case WDIOC_GETSUPPORT:
drivers/watchdog/sa1100_wdt.c +3 -2
index ee1caae..0162454 100644
@@ -38,7 +38,7 @@
 
 static unsigned long oscr_freq;
 static unsigned long sa1100wdt_users;
-static int pre_margin;
+static unsigned int pre_margin;
 static int boot_status;
 
 /*
@@ -84,6 +84,7 @@ static const struct watchdog_info ident = {
 	.options	= WDIOF_CARDRESET | WDIOF_SETTIMEOUT
 				| WDIOF_KEEPALIVEPING,
 	.identity	= "SA1100/PXA255 Watchdog",
+	.firmware_version	= 1,
 };
 
 static long sa1100dog_ioctl(struct file *file, unsigned int cmd,
@@ -118,7 +119,7 @@ static long sa1100dog_ioctl(struct file *file, unsigned int cmd,
 		if (ret)
 			break;
 
-		if (time <= 0 || time > 255) {
+		if (time <= 0 || (oscr_freq * (long long)time >= 0xffffffff)) {
 			ret = -EINVAL;
 			break;
 		}
drivers/watchdog/w83627hf_wdt.c +5 -0
index 916890a..f201acc 100644
@@ -89,6 +89,11 @@ static void w83627hf_select_wd_register(void)
 		c = ((inb_p(WDT_EFDR) & 0xf7) | 0x04); /* select WDT0 */
 		outb_p(0x2b, WDT_EFER);
 		outb_p(c, WDT_EFDR);	/* set GPIO3 to WDT0 */
+	} else if (c == 0x88) {	/* W83627EHF */
+		outb_p(0x2d, WDT_EFER); /* select GPIO5 */
+		c = inb_p(WDT_EFDR) & ~0x01; /* PIN77 -> WDT0# */
+		outb_p(0x2d, WDT_EFER);
+		outb_p(c, WDT_EFDR); /* set GPIO5 to WDT0 */
 	}
 
 	outb_p(0x07, WDT_EFER); /* point to logical device number reg */
drivers/watchdog/w83697ug_wdt.c +3 -1
index 883b5f7..a6c12de 100644
@@ -149,8 +149,10 @@ static void wdt_ctrl(int timeout)
 {
 	spin_lock(&io_lock);
 
-	if (w83697ug_select_wd_register() < 0)
+	if (w83697ug_select_wd_register() < 0) {
+		spin_unlock(&io_lock);
 		return;
+	}
 
 	outb_p(0xF4, WDT_EFER);    /* Select CRF4 */
 	outb_p(timeout, WDT_EFDR); /* Write Timeout counter to CRF4 */