[WATCHDOG] i8xx_tco.c-request_region-patch

From: Wim Van Sebroeck
Date: Fri Oct 29 2004 - 14:44:09 EST


Hi Andrew,

please do a

bk pull http://linux-watchdog.bkbits.net/linux-2.6-watchdog-mm

This will update the following files:

drivers/char/watchdog/i8xx_tco.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)

through these ChangeSets:

<castet.matthieu@xxxxxxx> (04/10/29 1.2338)
[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.


The ChangeSets can also be looked at on:
http://linux-watchdog.bkbits.net:8080/linux-2.6-watchdog-mm

For completeness, I added the patches below.

Greetings,
Wim.

================================================================================
diff -Nru a/drivers/char/watchdog/i8xx_tco.c b/drivers/char/watchdog/i8xx_tco.c
--- a/drivers/char/watchdog/i8xx_tco.c 2004-10-29 20:38:59 +02:00
+++ b/drivers/char/watchdog/i8xx_tco.c 2004-10-29 20:38:59 +02:00
@@ -415,12 +415,15 @@
}
}
/* 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;
@@ -442,6 +445,10 @@
ret = -EIO;
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)) {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/