|
@@ -33,6 +33,7 @@
|
|
#include <linux/notifier.h>
|
|
#include <linux/notifier.h>
|
|
#include <linux/reboot.h>
|
|
#include <linux/reboot.h>
|
|
#include <linux/init.h>
|
|
#include <linux/init.h>
|
|
|
|
+#include <linux/spinlock.h>
|
|
|
|
|
|
#include <asm/io.h>
|
|
#include <asm/io.h>
|
|
#include <asm/uaccess.h>
|
|
#include <asm/uaccess.h>
|
|
@@ -44,6 +45,7 @@
|
|
|
|
|
|
static unsigned long wdt_is_open;
|
|
static unsigned long wdt_is_open;
|
|
static char expect_close;
|
|
static char expect_close;
|
|
|
|
+static spinlock_t io_lock;
|
|
|
|
|
|
/* You must set this - there is no sane way to probe for this board. */
|
|
/* You must set this - there is no sane way to probe for this board. */
|
|
static int wdt_io = 0x2E;
|
|
static int wdt_io = 0x2E;
|
|
@@ -110,12 +112,16 @@ w83627hf_init(void)
|
|
static void
|
|
static void
|
|
wdt_ctrl(int timeout)
|
|
wdt_ctrl(int timeout)
|
|
{
|
|
{
|
|
|
|
+ spin_lock(&io_lock);
|
|
|
|
+
|
|
w83627hf_select_wd_register();
|
|
w83627hf_select_wd_register();
|
|
|
|
|
|
outb_p(0xF6, WDT_EFER); /* Select CRF6 */
|
|
outb_p(0xF6, WDT_EFER); /* Select CRF6 */
|
|
outb_p(timeout, WDT_EFDR); /* Write Timeout counter to CRF6 */
|
|
outb_p(timeout, WDT_EFDR); /* Write Timeout counter to CRF6 */
|
|
|
|
|
|
w83627hf_unselect_wd_register();
|
|
w83627hf_unselect_wd_register();
|
|
|
|
+
|
|
|
|
+ spin_unlock(&io_lock);
|
|
}
|
|
}
|
|
|
|
|
|
static int
|
|
static int
|
|
@@ -303,6 +309,8 @@ wdt_init(void)
|
|
{
|
|
{
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
|
|
+ spin_lock_init(&io_lock);
|
|
|
|
+
|
|
printk(KERN_INFO "WDT driver for the Winbond(TM) W83627HF Super I/O chip initialising.\n");
|
|
printk(KERN_INFO "WDT driver for the Winbond(TM) W83627HF Super I/O chip initialising.\n");
|
|
|
|
|
|
if (wdt_set_heartbeat(timeout)) {
|
|
if (wdt_set_heartbeat(timeout)) {
|