[PATCH] pcmcia: fix multiple insertion of multifunction cards

Dominik Brodowski linux at dominikbrodowski.net
Mon Aug 1 08:55:51 EDT 2005


Linus, Andrew,

Please apply also this one for 2.6.13.

Thanks,
	Dominik


The ordering of setting and clearing device_add_pending went wrong on some
occasions, causing multifunction cards only to be handled correctly on the
first insertion, not on subsequent ones.

Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>

Index: 2.6.13-rc4-git1/drivers/pcmcia/ds.c
===================================================================
--- 2.6.13-rc4-git1.orig/drivers/pcmcia/ds.c
+++ 2.6.13-rc4-git1/drivers/pcmcia/ds.c
@@ -589,8 +589,8 @@ static void pcmcia_delayed_add_pseudo_de
 static inline void pcmcia_add_pseudo_device(struct pcmcia_socket *s)
 {
 	if (!s->pcmcia_state.device_add_pending) {
-		schedule_work(&s->device_add);
 		s->pcmcia_state.device_add_pending = 1;
+		schedule_work(&s->device_add);
 	}
 	return;
 }



More information about the linux-pcmcia mailing list