linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [WATCHDOG] v2.6.10-rc2 i8xx_tco.c-request_region-patch
@ 2004-11-30  8:19 Wim Van Sebroeck
  0 siblings, 0 replies; only message in thread
From: Wim Van Sebroeck @ 2004-11-30  8:19 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, Andrew Morton, castet.matthieu

Hi Linus, Andrew,

please do a

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

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@free.fr> (04/10/29 1.2026.42.1)
   [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

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-11-30 09:08:10 +01:00
+++ b/drivers/char/watchdog/i8xx_tco.c	2004-11-30 09:08:10 +01: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)) {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-11-30  8:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-30  8:19 [WATCHDOG] v2.6.10-rc2 i8xx_tco.c-request_region-patch Wim Van Sebroeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).