removal of check_region from i82365 driver not quite right?

Ian Campbell icampbell at arcom.com
Wed Jun 29 09:27:19 EDT 2005


[I'm not subscribed to linux-pcmcia so please CC me]

http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f354942cb301fed273f423fb5c4f57bde3efc5b2

converted the check_region() calls in drivers/pcmcia/i82365.c into
request_regions. Unfortunately this seems to have broken things.

isa_probe() used to call check_region() and then call add_pcic() which
would request_region(). 

Now isa_probe() calls request_region() and then calls add_pcic() which
calls request_region() again, this fails and add_pcic() returns
immediately without doing all the setup etc.

On the face of it the patch below fixes the problem, by not doing the
second request region in add_pcic(). I think this is preferable to
remove the call in isa_probe() since identify() touches the I/O regions
and is called before add_pcic().

However I haven't fully grokked the meaning of the code which follows
the request_region() in isa_probe(), so I'm not sure that the handling
WRT multiple sockets and multiple bridge chips is correct. In particular
I'm not convinced that the regions for subsequent sockets and/or bridges
will be requested at all. I suspect a more thorough reworking by someone
who understands what is going on there might be in order.

I should mention that I'm actually messing about with this on an ARM
platform with wacky memory and i/o mapping offsets etc, it doesn't quite
work yet for other reasons which preclude full testing etc, but I think
the problem above is still present for more normal x86 stuff.

Ian.

--- 2.6.orig/drivers/pcmcia/i82365.c	2005-06-29 11:11:14.000000000 +0100
+++ 2.6/drivers/pcmcia/i82365.c	2005-06-29 14:14:50.000000000 +0100
@@ -698,14 +698,6 @@
     struct i82365_socket *t = &socket[sockets-ns];
 
     base = sockets-ns;
-    if (t->ioaddr > 0) {
-	if (!request_region(t->ioaddr, 2, "i82365")) {
-	    printk(KERN_ERR "i82365: IO region conflict at %#lx, not available\n",
-			t->ioaddr);
-	    return;
-	}
-    }
-    
     if (base == 0) printk("\n");
     printk(KERN_INFO "  %s", pcic[type].name);
     printk(" ISA-to-PCMCIA at port %#lx ofs 0x%02x",




-- 
Ian Campbell, Senior Design Engineer
                                        Web: http://www.arcom.com
Arcom, Clifton Road,                    Direct: +44 (0)1223 403 465
Cambridge CB1 7EA, United Kingdom       Phone:  +44 (0)1223 411 200


_____________________________________________________________________
The message in this transmission is sent in confidence for the attention of the addressee only and should not be disclosed to any other party. Unauthorised recipients are requested to preserve this confidentiality. Please advise the sender if the addressee is not resident at the receiving end.  Email to and from Arcom is automatically monitored for operational and lawful business reasons.

This message has been virus scanned by MessageLabs.



More information about the linux-pcmcia mailing list