Move the interrupt clear to before processing, this avoids a
possible transmit races.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>


--- sky2-1.0.orig/drivers/net/sky2.c
+++ sky2-1.0/drivers/net/sky2.c
@@ -1833,6 +1833,8 @@ static int sky2_poll(struct net_device *
u16 hwidx;
u16 tx_done[2] = { TX_NO_STATUS, TX_NO_STATUS };

+       sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ);
+
hwidx = sky2_read16(hw, STAT_PUT_IDX);
BUG_ON(hwidx >= STATUS_RING_SIZE);
rmb();
@@ -1912,12 +1914,10 @@ static int sky2_poll(struct net_device *
}

exit_loop:
-       sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ);
-
sky2_tx_check(hw, 0, tx_done[0]);
sky2_tx_check(hw, 1, tx_done[1]);

-       if (sky2_read16(hw, STAT_PUT_IDX) == hw->st_idx) {
+       if (likely(work_done < to_do)) {
        /* need to restart TX timer */
        if (is_ec_a1(hw)) {
                sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_STOP);

--

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to