A patch for eepro driver

H.J. Lu (hjl@valinux.com)
Fri, 15 Oct 1999 11:35:16 -0700 (PDT)


Hi,

Here is a patch for eepro100 in Linux 2.2.12. Without this patch,
the machine will lock up when the interface is enabled if there are
several devices sharing the same interrupt with eepro100 and they
are registered first.

Thanks.

-- 
H.J. Lu (hjl@gnu.org)
--
--- linux/drivers/net/eepro100.c	Wed Oct 13 12:03:37 1999
+++ linux-test/drivers/net/eepro100.c	Fri Oct 15 11:27:28 1999
@@ -823,6 +823,18 @@ speedo_open(struct device *dev)
 	dev->interrupt = 0;
 	dev->start = 1;
 
+	/*
+	 * Request the IRQ last, after we have set up all data structures.
+	 * It would be bad to get an interrupt before we're ready.
+	 *
+	 * Register ourself first before turn on the interrupt. Someone
+	 * else may share the same interrupt. H.J.
+	 */
+	if (request_irq(dev->irq, &speedo_interrupt, SA_SHIRQ,
+					"Intel EtherExpress Pro 10/100 Ethernet", dev)) {
+		return -EAGAIN;
+	}
+
 	/* Start the chip's Tx process and unmask interrupts. */
 	/* Todo: verify that we must wait for previous command completion. */
 	wait_for_cmd_done(ioaddr + SCBCmd);
@@ -843,15 +855,6 @@ speedo_open(struct device *dev)
 
 	wait_for_cmd_done(ioaddr + SCBCmd);
 	outw(CU_DUMPSTATS, ioaddr + SCBCmd);
-
-	/*
-	 * Request the IRQ last, after we have set up all data structures.
-	 * It would be bad to get an interrupt before we're ready.
-	 */
-	if (request_irq(dev->irq, &speedo_interrupt, SA_SHIRQ,
-					"Intel EtherExpress Pro 10/100 Ethernet", dev)) {
-		return -EAGAIN;
-	}
 
 	/* No need to wait for the command unit to accept here. */
 	if ((sp->phy[0] & 0x8000) == 0)

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/