Thread (21 messages) flat view 21 messages, 6 authors, 2006-02-27

Re: [PATCH] Revert sky2 to 0.13a

From: Stephen Hemminger <hidden>
Date: 2006-02-26 02:00:37
Also in: lkml

Instead of whining, try this.

--- drivers/net/sky2.c.orig	2006-02-25 18:02:10.000000000 -0800
+++ drivers/net/sky2.c	2006-02-25 18:03:13.000000000 -0800
@@ -1895,19 +1895,6 @@
 	u16 hwidx;
 	u16 tx_done[2] = { TX_NO_STATUS, TX_NO_STATUS };
 
-	sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ);
-
-	/*
-	 * Kick the STAT_LEV_TIMER_CTRL timer.
-	 * This fixes my hangs on Yukon-EC (0xb6) rev 1.
-	 * The if clause is there to start the timer only if it has been
-	 * configured correctly and not been disabled via ethtool.
-	 */
-	if (sky2_read8(hw, STAT_LEV_TIMER_CTRL) == TIM_START) {
-		sky2_write8(hw, STAT_LEV_TIMER_CTRL, TIM_STOP);
-		sky2_write8(hw, STAT_LEV_TIMER_CTRL, TIM_START);
-	}
-
 	hwidx = sky2_read16(hw, STAT_PUT_IDX);
 	BUG_ON(hwidx >= STATUS_RING_SIZE);
 	rmb();
@@ -1995,7 +1982,20 @@
 		sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_START);
 	}
 
-	if (likely(work_done < to_do)) {
+	sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ);
+
+	/*
+	 * Kick the STAT_LEV_TIMER_CTRL timer.
+	 * This fixes my hangs on Yukon-EC (0xb6) rev 1.
+	 * The if clause is there to start the timer only if it has been
+	 * configured correctly and not been disabled via ethtool.
+	 */
+	if (sky2_read8(hw, STAT_LEV_TIMER_CTRL) == TIM_START) {
+		sky2_write8(hw, STAT_LEV_TIMER_CTRL, TIM_STOP);
+		sky2_write8(hw, STAT_LEV_TIMER_CTRL, TIM_START);
+	}
+
+	if (sky2_read16(hw, STAT_PUT_IDX) == hw->st_idx) {
 		spin_lock_irq(&hw->hw_lock);
 		__netif_rx_complete(dev0);
 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help