lkml.org 
[lkml]   [2006]   [Jul]   [4]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] pcmcia: update alloc_io_space for conflict checking for multifunction PC card for Linux kernel 2.6.15.4.
DateTue, 4 Jul 2006 11:01:13 +0530
From<>
Hi,

Some PCMCIA cards do not mention specific IO addresses in the CIS.
In that case, inside the alloc_io_space function, conflicts are detected
(the function returns 1) for the second function of a multifunction card
unless the length of IO address range required is greater than 0x100.
The following patch will remove this conflict checking for a PCMCIA
function which had not mentioned any specific IO address to be mapped
from. 
The patch is tested for Linux kernel 2.6.15.4 and works fine in the
above case and is as suggested by Dave Hinds.


Signed-off-by: Kaustav Majumdar <kaustav.majumdar@wipro.com>

--- linux-2.6.15.4/drivers/pcmcia/pcmcia_resource.c.orig
2006-07-03 15:02:31.000000000 +0530
+++ linux-2.6.15.4/drivers/pcmcia/pcmcia_resource.c	2006-07-03
15:03:01.000000000 +0530
@@ -97,7 +97,7 @@ static int alloc_io_space(struct pcmcia_
 	 * potential conflicts, just the most obvious ones.
 	 */
 	for (i = 0; i < MAX_IO_WIN; i++)
-		if ((s->io[i].NumPorts != 0) &&
+		if ((s->io[i].NumPorts != 0) && (*base != 0) &&
 		    ((s->io[i].BasePort & (align-1)) == *base))
 			return 1;
 	for (i = 0; i < MAX_IO_WIN; i++) {

Regards,
Kaustav Majumdar 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-07-04 05:34    [from the cache]
©2003-2008