Commit 9d9a5415 authored by Matthieu Castet's avatar Matthieu Castet Committed by Vojtech Pavlik

[WATCHDOG] i8xx_tco.c-request_region-patch

Fix: in i8xx_tco.c, during the initialisation, the driver accesses io
without checking if the port is free.
parent eec2e667
......@@ -415,12 +415,15 @@ static unsigned char __init i8xx_tco_getdevice (void)
}
}
/* Set the TCO_EN bit in SMI_EN register */
if (!request_region (SMI_EN + 1, 1, "i8xx TCO")) {
printk (KERN_ERR PFX "I/O address 0x%04x already in use\n",
SMI_EN + 1);
return 0;
}
val1 = inb (SMI_EN + 1);
val1 &= 0xdf;
outb (val1, SMI_EN + 1);
/* Clear out the (probably old) status */
outb (0, TCO1_STS);
outb (3, TCO2_STS);
release_region (SMI_EN + 1, 1);
return 1;
}
return 0;
......@@ -443,6 +446,10 @@ static int __init watchdog_init (void)
goto out;
}
/* Clear out the (probably old) status */
outb (0, TCO1_STS);
outb (3, TCO2_STS);
/* Check that the heartbeat value is within it's range ; if not reset to the default */
if (tco_timer_set_heartbeat (heartbeat)) {
heartbeat = WATCHDOG_HEARTBEAT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment