Crash in e1000_disable after download - solved

Peter Lundkvist <[email protected]> Wed, 17 Aug 2005 08:00:17 +0200
Newsgroups gmane.network.etherboot.devel
Message-ID <20050817060017.GA32026@localhost>
Hi,

I have experienced consistent crashes just after download on a
Pentium-M hardware with a 82546gb chip on the PCI-X bus. The same
image worked correctly on similar hardware with 82540ep.
Tested this with versions 5.2.6 and 5.4.0.
I have located the problem to e1000_disable(), which seems to
disable the chip in wrong order; the chip reset is done before
the ethernet interface is turned off. If this is done in the
same order as in the linux driver everything works ok.

I have included a patch against 5.4/HEAD to solve this problem.

Regards,
Peter

Index: src/drivers/net/e1000.c
===================================================================
RCS file: /cvsroot/etherboot/etherboot/etherboot-5.4/src/drivers/net/e1000.c,v
retrieving revision 1.2
diff -u -r1.2 e1000.c
--- src/drivers/net/e1000.c	11 Jul 2005 19:13:58 -0000	1.2
+++ src/drivers/net/e1000.c	16 Aug 2005 14:41:05 -0000
@@ -3550,6 +3550,12 @@
 	E1000_WRITE_REG (&hw, RDH, 0);
 	E1000_WRITE_REG (&hw, RDT, 0);
 
+	/* Turn off the ethernet interface */
+	E1000_WRITE_REG (&hw, RCTL, 0);
+	E1000_WRITE_REG (&hw, TCTL, 0);
+	E1000_WRITE_FLUSH(&hw);
+	mdelay (10);
+
 	/* put the card in its initial state */
 	switch(hw.mac_type) {
 		case e1000_82544:
@@ -3572,11 +3578,6 @@
 			break;
 	}
 
-	/* Turn off the ethernet interface */
-	E1000_WRITE_REG (&hw, RCTL, 0);
-	E1000_WRITE_REG (&hw, TCTL, 0);
-	mdelay (10);
-
 	/* Unmap my window to the device */
 	iounmap(hw.hw_addr);
 }



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf