Fixed opening device. stable-1.5
authorFlorian Pose <fp@igh-essen.com>
Wed, 25 Jan 2012 17:44:35 +0100
branchstable-1.5
changeset 2280 0d8a043a6adb
parent 2279 416575d0ab37
child 2286 03be7b751d08
Fixed opening device.
devices/r8169-2.6.35-ethercat.c
--- a/devices/r8169-2.6.35-ethercat.c	Wed Jan 25 16:05:40 2012 +0100
+++ b/devices/r8169-2.6.35-ethercat.c	Wed Jan 25 17:44:35 2012 +0100
@@ -3214,6 +3214,7 @@
 
 	// offer device to EtherCAT master module
 	tp->ecdev = ecdev_offer(dev, ec_poll, THIS_MODULE);
+	tp->ec_watchdog_jiffies = jiffies;
 
 	if (!tp->ecdev) {
 		rc = register_netdev(dev);
@@ -3245,6 +3246,11 @@
 	}
 	pm_runtime_idle(&pdev->dev);
 
+	if (tp->ecdev && ecdev_open(tp->ecdev)) {
+		ecdev_withdraw(tp->ecdev);
+		goto err_out_msi_4;
+	}
+
 out:
 	return rc;
 
@@ -4687,7 +4693,7 @@
 		}
 
 		/* Work around for rx fifo overflow */
-		if (unlikely(status & RxFIFOOver) &&
+		if (unlikely(!tp->ecdev && (status & RxFIFOOver)) &&
 		(tp->mac_version == RTL_GIGA_MAC_VER_11)) {
 			netif_stop_queue(dev);
 			rtl8169_tx_timeout(dev);