[PATCH] sky2: poke coalescing timer to fix hang
authorStephen Hemminger <shemminger@osdl.org>
Wed, 22 Feb 2006 19:45:00 +0000 (11:45 -0800)
committerFrancois Romieu <romieu@fr.zoreil.com>
Thu, 23 Feb 2006 00:24:04 +0000 (01:24 +0100)
Need to restart the interrupt coalescing timer after clearing the interrupt,
to avoid races with interrupt timer and processing.

Patch from Carl-Daniel Halfinger

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
drivers/net/sky2.c

index cf7fd28d67767e0325e09bb5861d521499189799..629809433cb38fea64b7e02ff64bdd5c78669b9a 100644 (file)
@@ -1895,6 +1895,17 @@ static int sky2_poll(struct net_device *dev0, int *budget)
 
        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();