+ ipmi-reserve-i-o-ports-separately.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     IPMI: reserve I/O ports separately

has been added to the -mm tree.  Its filename is

     ipmi-reserve-i-o-ports-separately.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: IPMI: reserve I/O ports separately
From: Corey Minyard <minyard@xxxxxxx>


This patch is pretty important to get in for IPMI, new systems have been
changing the way ACPI and IPMI interact, and this works around the problems
for now.  This is a temporary fix until we get proper ACPI handling in
IPMI.

Fixed releasing already-allocated regions when a later request fails, and
forward-ported it to HEAD.

Some BIOSes reserve disjoint I/O regions in their ACPI tables for the IPMI
controller.  This causes problems when trying to register the entire I/O
region.  Therefore we must register each I/O port separately.

Signed-off-by: Jordan Hargrave <Jordan_Hargrave@xxxxxxxx>
Signed-off-by: Matt Domsch <Matt_Domsch@xxxxxxxx>
Signed-off-by: Corey Minyard <minyard@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/char/ipmi/ipmi_si_intf.c |   38 ++++++++++++++++-------------
 1 files changed, 22 insertions(+), 16 deletions(-)

diff -puN drivers/char/ipmi/ipmi_si_intf.c~ipmi-reserve-i-o-ports-separately drivers/char/ipmi/ipmi_si_intf.c
--- 25/drivers/char/ipmi/ipmi_si_intf.c~ipmi-reserve-i-o-ports-separately	Fri May 26 14:22:04 2006
+++ 25-akpm/drivers/char/ipmi/ipmi_si_intf.c	Fri May 26 14:23:52 2006
@@ -1184,20 +1184,20 @@ static void port_outl(struct si_sm_io *i
 static void port_cleanup(struct smi_info *info)
 {
 	unsigned int addr = info->io.addr_data;
-	int          mapsize;
+	int          idx;
 
 	if (addr) {
-		mapsize = ((info->io_size * info->io.regspacing)
-			   - (info->io.regspacing - info->io.regsize));
-
-		release_region (addr, mapsize);
+	  	for (idx = 0; idx < info->io_size; idx++) {
+			release_region(addr + idx * info->io.regspacing,
+				       info->io.regsize);
+		}
 	}
 }
 
 static int port_setup(struct smi_info *info)
 {
 	unsigned int addr = info->io.addr_data;
-	int          mapsize;
+	int          idx;
 
 	if (!addr)
 		return -ENODEV;
@@ -1225,16 +1225,22 @@ static int port_setup(struct smi_info *i
 		return -EINVAL;
 	}
 
-	/* Calculate the total amount of memory to claim.  This is an
-	 * unusual looking calculation, but it avoids claiming any
-	 * more memory than it has to.  It will claim everything
-	 * between the first address to the end of the last full
-	 * register. */
-	mapsize = ((info->io_size * info->io.regspacing)
-		   - (info->io.regspacing - info->io.regsize));
-
-	if (request_region(addr, mapsize, DEVICE_NAME) == NULL)
-		return -EIO;
+	/* Some BIOSes reserve disjoint I/O regions in their ACPI
+	 * tables.  This causes problems when trying to register the
+	 * entire I/O region.  Therefore we must register each I/O
+	 * port separately.
+	 */
+  	for (idx = 0; idx < info->io_size; idx++) {
+		if (request_region(addr + idx * info->io.regspacing,
+				   info->io.regsize, DEVICE_NAME) == NULL) {
+			/* Undo allocations */
+			while (idx--) {
+				release_region(addr + idx * info->io.regspacing,
+					       info->io.regsize);
+			}
+			return -EIO;
+		}
+	}
 	return 0;
 }
 
_

Patches currently in -mm which might be from minyard@xxxxxxx are

ipmi-reserve-i-o-ports-separately.patch
git-watchdog.patch
strstrip-api.patch
ipmi-strstrip-conversion.patch
drivers-char-ipmi-ipmi_msghandlerc-make-proc_ipmi_root-static.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux