--- linux-2.5.38-vanilla/drivers/pcmcia/tcic.c	2002-09-22 01:25:11.000000000 -0300
+++ linux-2.5.38/drivers/pcmcia/tcic.c	2002-09-27 11:57:07.000000000 -0300
@@ -138,6 +138,8 @@
     0, 0		/* No PCI or CardBus support */
 };
 
+static spinlock_t tcic_exit_lock;
+
 /*====================================================================*/
 
 /* Trick when selecting interrupts: the TCIC sktirq pin is supposed
@@ -518,15 +520,15 @@
 {
     u_long flags;
     unregister_ss_entry(&tcic_operations);
-    save_flags(flags);
-    cli();
+
+    spin_lock_irqsave(&tcic_exit_lock, flags);
     if (cs_irq != 0) {
 	tcic_aux_setw(TCIC_AUX_SYSCFG, TCIC_SYSCFG_AUTOBUSY|0x0a00);
 	free_irq(cs_irq, tcic_interrupt);
     }
     if (tcic_timer_pending)
 	del_timer(&poll_timer);
-    restore_flags(flags);
+    spin_unlock_irqrestore(&tcic_exit_lock, flags);
     release_region(tcic_base, 16);
 } /* exit_tcic */
 
@@ -971,6 +973,8 @@
 	pccard_io_map io = { 0, 0, 0, 0, 1 };
 	pccard_mem_map mem = { 0, 0, 0, 0, 0, 0 };
 
+	spin_lock_init(&tcic_exit_lock);
+
 	mem.sys_stop = 0x1000;
 	tcic_set_socket(s, &dead_socket);
 	for (i = 0; i < 2; i++) {
