[PATCH] update alloc_io_space for conflict checking for multifunction PC card.

kaustav.majumdar at wipro.com kaustav.majumdar at wipro.com
Thu Jun 8 02:11:31 EDT 2006


In the alloc_io_space function, checking for obvious conflicts returns 1
(finds a conflict) for the 2nd PCMCIA function if there will be no IO
address mentioned in the CIS for both functions of a multifunction
PCMCIA card
and (align -1) is less than 0x100.
Since the value of the variable align is calculated from the length of
IO space required to be allocated, if the request by the 2nd function of
a multifunction card is less than 0x100 then it causes a conflict.
The following patch is as suggested by Dave Hinds and it removes the
checking for a function when the PCMCIA function is not mentioning any
particular address as its starting IO address.
The patch is tested and works fine for the said case.


--- a/drivers/pcmcia/pcmcia_resource.c	2006-02-10 12:52:48.000000000
+0530
+++ b/drivers/pcmcia/pcmcia_resource.c	2006-06-02 14:21:00.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++) {

Thank you,
With Regards,
Kaustav Majumdar


The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com



More information about the linux-pcmcia mailing list