From 41d27a220c331ed20f2241db20855d42f390b168 Mon Sep 17 00:00:00 2001
From: Florian Pose <fp@igh-essen.com>
Date: Fri, 3 Nov 2006 10:00:08 +0000
Subject: [PATCH] Fixed memory barrier bug in 8139too drivers.

---
 devices/8139too-2.6.13-ethercat.c | 11 ++++++-----
 devices/8139too-2.6.17-ethercat.c | 11 ++++++-----
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/devices/8139too-2.6.13-ethercat.c b/devices/8139too-2.6.13-ethercat.c
index b6c94678..bb9933b4 100644
--- a/devices/8139too-2.6.13-ethercat.c
+++ b/devices/8139too-2.6.13-ethercat.c
@@ -1969,11 +1969,12 @@ static void rtl8139_tx_interrupt (struct net_device *dev,
 	}
 #endif /* RTL8139_NDEBUG */
 
-	if (dev != rtl_ec_net_dev) {
-		/* only wake the queue if we did work, and the queue is stopped */
-		if (tp->dirty_tx != dirty_tx) {
-			tp->dirty_tx = dirty_tx;
-			mb();
+	/* only wake the queue if we did work, and the queue is stopped */
+	if (tp->dirty_tx != dirty_tx) {
+		tp->dirty_tx = dirty_tx;
+		mb();
+
+		if (dev != rtl_ec_net_dev) {
 			netif_wake_queue (dev);
 		}
 	}
diff --git a/devices/8139too-2.6.17-ethercat.c b/devices/8139too-2.6.17-ethercat.c
index b8f60d1c..4103204b 100644
--- a/devices/8139too-2.6.17-ethercat.c
+++ b/devices/8139too-2.6.17-ethercat.c
@@ -1976,11 +1976,12 @@ static void rtl8139_tx_interrupt (struct net_device *dev,
 	}
 #endif /* RTL8139_NDEBUG */
 
-	if (dev != rtl_ec_net_dev) {
-		/* only wake the queue if we did work, and the queue is stopped */
-		if (tp->dirty_tx != dirty_tx) {
-			tp->dirty_tx = dirty_tx;
-			mb();
+	/* only wake the queue if we did work, and the queue is stopped */
+	if (tp->dirty_tx != dirty_tx) {
+		tp->dirty_tx = dirty_tx;
+		mb();
+
+		if (dev != rtl_ec_net_dev) {
 			netif_wake_queue (dev);
 		}
 	}
-- 
GitLab