aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sky2.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2006-01-30 14:37:58 -0500
committerJeff Garzik <jgarzik@pobox.com>2006-02-07 02:00:35 -0500
commitf9a66c7f5fa2262656a1a38ae9b57a2a89980f36 (patch)
tree84c9b58afbeaabc9d8468b6783d7bc827f7eeeae /drivers/net/sky2.c
parenta8ab1ec0c3ef4ce2033abe3441d032fe1490a71a (diff)
[PATCH] sky2: clear irq race
Move the interrupt clear to before processing, this avoids a possible races with status delaying. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net/sky2.c')
-rw-r--r--drivers/net/sky2.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 6cd075e1f38a..aff7b9dee38e 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -1833,6 +1833,8 @@ static int sky2_poll(struct net_device *dev0, int *budget)
1833 u16 hwidx; 1833 u16 hwidx;
1834 u16 tx_done[2] = { TX_NO_STATUS, TX_NO_STATUS }; 1834 u16 tx_done[2] = { TX_NO_STATUS, TX_NO_STATUS };
1835 1835
1836 sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ);
1837
1836 hwidx = sky2_read16(hw, STAT_PUT_IDX); 1838 hwidx = sky2_read16(hw, STAT_PUT_IDX);
1837 BUG_ON(hwidx >= STATUS_RING_SIZE); 1839 BUG_ON(hwidx >= STATUS_RING_SIZE);
1838 rmb(); 1840 rmb();
@@ -1912,12 +1914,10 @@ static int sky2_poll(struct net_device *dev0, int *budget)
1912 } 1914 }
1913 1915
1914exit_loop: 1916exit_loop:
1915 sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ);
1916
1917 sky2_tx_check(hw, 0, tx_done[0]); 1917 sky2_tx_check(hw, 0, tx_done[0]);
1918 sky2_tx_check(hw, 1, tx_done[1]); 1918 sky2_tx_check(hw, 1, tx_done[1]);
1919 1919
1920 if (sky2_read16(hw, STAT_PUT_IDX) == hw->st_idx) { 1920 if (likely(work_done < to_do)) {
1921 /* need to restart TX timer */ 1921 /* need to restart TX timer */
1922 if (is_ec_a1(hw)) { 1922 if (is_ec_a1(hw)) {
1923 sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_STOP); 1923 sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_STOP);