Bug : Can't read CIS (2.6.0-test4)

Russell King rmk at arm.linux.org.uk
Wed Sep 17 21:20:01 BST 2003


On Sun, Sep 14, 2003 at 11:36:10PM -0400, Pavel Roskin wrote:
> On Tue, 9 Sep 2003, Russell King wrote:
> > This means the correct way to remove the modules is:
> >
> > 	cardctl eject
> > 	rmmod ds
> > 	rmmod i82365
> > 	rmmod pcmcia_core
> >
> > or
> >
> > 	cardctl eject
> > 	rmmod i82365
> > 	rmmod ds
> > 	rmmod pcmcia_core
> 
> Not sure about i82365, but the later would crash with yenta_socket and
> plx9052, as described here:
> http://lists.infradead.org/pipermail/linux-pcmcia/2003-August/000184.html
> 
> Still true with 2.6.0-test5-bk3.  New backtrace is attached.

Hmm, interesting.  I think I can see what's going on here, but I just
can't reproduce it here:

bash-2.04# lsmod
Module                  Size  Used by
ds                     11688  0 
pcmcia_core            63828  1 ds
bash-2.04# insmod yenta_socket.ko
irq 21: nobody cared
Socket status: 30000007
irq 22: nobody cared
Socket status: 30000007
bash-2.04# rmmod yenta_socket
... etc ...

So, here's a patch which may solve your problem - as I can't reproduce it,
please confirm whether this solves it for you:

--- orig/drivers/pcmcia/cs.c	Wed Sep 17 17:02:35 2003
+++ linux/drivers/pcmcia/cs.c	Wed Sep 17 17:09:08 2003
@@ -326,18 +326,18 @@
 		wake_up(&socket->thread_wait);
 		wait_for_completion(&socket->thread_done);
 	}
-	release_cis_mem(socket);
+}
+
+static void pcmcia_release_socket(struct class_device *class_dev)
+{
+	struct pcmcia_socket *socket = class_get_devdata(class_dev);
+
 	while (socket->clients) {
 		client = socket->clients;
 		socket->clients = socket->clients->next;
 		kfree(client);
 	}
-	socket->ops = NULL;
-}
 
-static void pcmcia_release_socket(struct class_device *class_dev)
-{
-	struct pcmcia_socket *socket = class_get_devdata(class_dev);
 	complete(&socket->socket_released);
 }
 
@@ -389,6 +389,8 @@
 		return -EINVAL;
 	}
 
+	socket->ops = NULL;
+
 	return 0;
 } /* pcmcia_register_socket */
 EXPORT_SYMBOL(pcmcia_register_socket);



-- 
Russell King (rmk at arm.linux.org.uk)	http://www.arm.linux.org.uk/personal/
Linux kernel maintainer of:
  2.6 ARM Linux   - http://www.arm.linux.org.uk/
  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
  2.6 Serial core



More information about the linux-pcmcia mailing list