提交 f9a66c7f 编写于 作者: S Stephen Hemminger 提交者: Jeff Garzik

[PATCH] sky2: clear irq race

Move the interrupt clear to before processing, this avoids a
possible races with status delaying.
Signed-off-by: NStephen Hemminger <shemminger@osdl.org>
Signed-off-by: NJeff Garzik <jgarzik@pobox.com>
上级 a8ab1ec0
...@@ -1833,6 +1833,8 @@ static int sky2_poll(struct net_device *dev0, int *budget) ...@@ -1833,6 +1833,8 @@ static int sky2_poll(struct net_device *dev0, int *budget)
u16 hwidx; u16 hwidx;
u16 tx_done[2] = { TX_NO_STATUS, TX_NO_STATUS }; 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); hwidx = sky2_read16(hw, STAT_PUT_IDX);
BUG_ON(hwidx >= STATUS_RING_SIZE); BUG_ON(hwidx >= STATUS_RING_SIZE);
rmb(); rmb();
...@@ -1912,12 +1914,10 @@ static int sky2_poll(struct net_device *dev0, int *budget) ...@@ -1912,12 +1914,10 @@ static int sky2_poll(struct net_device *dev0, int *budget)
} }
exit_loop: exit_loop:
sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ);
sky2_tx_check(hw, 0, tx_done[0]); sky2_tx_check(hw, 0, tx_done[0]);
sky2_tx_check(hw, 1, tx_done[1]); 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 */ /* need to restart TX timer */
if (is_ec_a1(hw)) { if (is_ec_a1(hw)) {
sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_STOP); sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_STOP);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册