Fix hang on IBM Token Ring PCMCIA card ejection

Ejecting a PCMCIA IBM Token Ring card that has not had its dev->open()
called will reliably trigger an uninitialized spinlock oops when
spinlock debugging is enabled. The system then hangs, occasionally
softlockup oopsing. Apparently ibmtr.c:tok_interrupt() doesn't expect
to be called before tok_open(), but tok_interrupt() gets called anyway
when the card is ejected. So, set an already-existing flag which
causes tok_interrupt() to bail out early upon card ejection. Tested by
inserting and removing the PCMCIA card several times.

Signed-off-by: Paul Walmsley <paul@booyaka.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>

authored by Paul Walmsley and committed by Jeff Garzik 5bebf82f 5b982c5b

+9 -5
+9 -5
drivers/net/pcmcia/ibmtr_cs.c
··· 189 189 { 190 190 struct ibmtr_dev_t *info = link->priv; 191 191 struct net_device *dev = info->dev; 192 + struct tok_info *ti = netdev_priv(dev); 192 193 193 194 DEBUG(0, "ibmtr_detach(0x%p)\n", link); 195 + 196 + /* 197 + * When the card removal interrupt hits tok_interrupt(), 198 + * bail out early, so we don't crash the machine 199 + */ 200 + ti->sram_phys |= 1; 194 201 195 202 if (link->dev_node) 196 203 unregister_netdev(dev); 197 - 198 - { 199 - struct tok_info *ti = netdev_priv(dev); 200 - del_timer_sync(&(ti->tr_timer)); 201 - } 204 + 205 + del_timer_sync(&(ti->tr_timer)); 202 206 203 207 ibmtr_release(link); 204 208