提交 b690a377 编写于 作者: L Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog

* git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog:
  [WATCHDOG] w83627hf_wdt.c: add support for the W83627EHF support
  [WATCHDOG] SA1100 watchdog maximum timeout
  [WATCHDOG] w83697ug, fix lock imbalance
  [WATCHDOG] drivers/watchdog/bcm47xx_wdt.c: Remove unnecessary semicolons
...@@ -161,7 +161,7 @@ static long bcm47xx_wdt_ioctl(struct file *file, ...@@ -161,7 +161,7 @@ static long bcm47xx_wdt_ioctl(struct file *file,
{ {
void __user *argp = (void __user *)arg; void __user *argp = (void __user *)arg;
int __user *p = argp; int __user *p = argp;
int new_value, retval = -EINVAL;; int new_value, retval = -EINVAL;
switch (cmd) { switch (cmd) {
case WDIOC_GETSUPPORT: case WDIOC_GETSUPPORT:
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
static unsigned long oscr_freq; static unsigned long oscr_freq;
static unsigned long sa1100wdt_users; static unsigned long sa1100wdt_users;
static int pre_margin; static unsigned int pre_margin;
static int boot_status; static int boot_status;
/* /*
...@@ -84,6 +84,7 @@ static const struct watchdog_info ident = { ...@@ -84,6 +84,7 @@ static const struct watchdog_info ident = {
.options = WDIOF_CARDRESET | WDIOF_SETTIMEOUT .options = WDIOF_CARDRESET | WDIOF_SETTIMEOUT
| WDIOF_KEEPALIVEPING, | WDIOF_KEEPALIVEPING,
.identity = "SA1100/PXA255 Watchdog", .identity = "SA1100/PXA255 Watchdog",
.firmware_version = 1,
}; };
static long sa1100dog_ioctl(struct file *file, unsigned int cmd, static long sa1100dog_ioctl(struct file *file, unsigned int cmd,
...@@ -118,7 +119,7 @@ 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) if (ret)
break; break;
if (time <= 0 || time > 255) { if (time <= 0 || (oscr_freq * (long long)time >= 0xffffffff)) {
ret = -EINVAL; ret = -EINVAL;
break; break;
} }
......
...@@ -89,6 +89,11 @@ static void w83627hf_select_wd_register(void) ...@@ -89,6 +89,11 @@ static void w83627hf_select_wd_register(void)
c = ((inb_p(WDT_EFDR) & 0xf7) | 0x04); /* select WDT0 */ c = ((inb_p(WDT_EFDR) & 0xf7) | 0x04); /* select WDT0 */
outb_p(0x2b, WDT_EFER); outb_p(0x2b, WDT_EFER);
outb_p(c, WDT_EFDR); /* set GPIO3 to WDT0 */ 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 */ outb_p(0x07, WDT_EFER); /* point to logical device number reg */
......
...@@ -149,8 +149,10 @@ static void wdt_ctrl(int timeout) ...@@ -149,8 +149,10 @@ static void wdt_ctrl(int timeout)
{ {
spin_lock(&io_lock); spin_lock(&io_lock);
if (w83697ug_select_wd_register() < 0) if (w83697ug_select_wd_register() < 0) {
spin_unlock(&io_lock);
return; return;
}
outb_p(0xF4, WDT_EFER); /* Select CRF4 */ outb_p(0xF4, WDT_EFER); /* Select CRF4 */
outb_p(timeout, WDT_EFDR); /* Write Timeout counter to CRF4 */ outb_p(timeout, WDT_EFDR); /* Write Timeout counter to CRF4 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册