Skip to contentSkip to conversation

Prevent tulip cardbus cards from freezing machine

PATCH New Olaf Kirch 1 participant 1 message May 27, 2004

Subsystems (2)
lore
Share & tools
lore

Olaf Kirch

author
#0 lore raw

PATCH 1/1 Prevent tulip cardbus cards from freezing machine

Hi,

here's a patch that should prevent lockups with tulip cardbus cards after APM suspend/resume, or when pulling out the card.

The problem is that the status register seems to return 0xffffffff in this case, and tulip_poll thinks RxIntr is asserted all the time.

Please review.

Cheers
Olaf

Signature · 3 lines
Olaf Kirch     |  The Hardware Gods hate me.
[email protected]   |
---------------+ 
drivers/net/tulip/interrupt.c renamed from drivers/net/tulip/interrupt.c.suspend +7 -1
@@ -113,6 +113,7 @@
 	int entry = tp->cur_rx % RX_RING_SIZE;
 	int rx_work_limit = *budget;
 	int received = 0;
+	int csr5;
 
 	if (!netif_running(dev))
 		goto done;
@@ -254,7 +255,12 @@
                 * No idea how to fix this if "playing with fire" will fail
                 * tomorrow (night 011029). If it will not fail, we won
                 * finally: amount of IO did not increase at all. */
-       } while ((inl(dev->base_addr + CSR5) & RxIntr));
+	       csr5 = inl(dev->base_addr + CSR5);
+	       if (csr5 == 0xffffffff) {
+		       printk(KERN_DEBUG "tulip_poll: hardware disappeared.\n");
+		       break;
+	       }
+       } while (csr5 & RxIntr);
  
 done: