[PATCH] Fix kernel lockup in RTL-8169 gigabit ethernet driver

From: Adam Nielsen
Date: Sat Apr 03 2004 - 00:02:04 EST


Hi everyone,

This is a tiny patch that fixes a particularly annoying bug
in the Realtek 8169 gigabit ethernet driver. Due to a logic error,
there is a loop in an interrupt handler that often goes infinite, thus
locking up the entire computer. The attached patch fixes the problem.

I have patched against linux-2.6.5-rc2-bk6, however the source file in
question hasn't been modified for a long time, so the patch should apply
cleanly to any recent kernel version.

Cheers,
Adam.

--- linux-2.6.5-rc2-bk6/drivers/net/r8169.c 2004-03-27 17:38:03.000000000 +1000
+++ linux-2.6.5-rc2-bk6a/drivers/net/r8169.c 2004-03-31 18:45:10.000000000 +1000
@@ -33,6 +33,12 @@
- Copy mc_filter setup code from 8139cp
(includes an optimization, and avoids set_bit use)

+VERSION 1.2a <2004/03/31> Adam Nielsen (a.nielsen@xxxxxxxxxxxxxxxx)
+
+ "else break;" added to the if-statement in rtl8169_tx_interrupt() to prevent
+ an infinite loop and the resulting kernel lockup when the interrupt is called
+ with a dirty buffer (perhaps when there's nothing to transmit?)
+
*/

#include <linux/module.h>
@@ -892,7 +898,7 @@
tp->Tx_skbuff[entry] = NULL;
dirty_tx++;
tx_left--;
- }
+ } else break;
}

if (tp->dirty_tx != dirty_tx) {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/