aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/sky2.c
diff options
context:
space:
mode:
authorStephen Hemminger2005-12-09 11:35:05 -0800
committerJeff Garzik2005-12-12 15:27:21 -0500
commit3e4b32e11674a40cf50e48a79764f12988641e20 (patch)
tree228cf5cbb3d9234a5324fa938f51461850e8f599 /drivers/net/sky2.c
parentaf2a58acb12f6b19e6f04b730203e199abedc44a (diff)
[PATCH] sky2: interrupt/poll optimization
Optimize poll routine by not clearing interrupt till after processing, and checking for more work before re-enable. 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, 2 insertions, 4 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 21aeb0c91fa6..af9739c1ef5f 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -1736,7 +1736,6 @@ static int sky2_poll(struct net_device *dev0, int *budget)
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();
@@ -1754,8 +1753,6 @@ static int sky2_poll(struct net_device *dev0, int *budget)
hw->st_idx = (hw->st_idx + 1) % STATUS_RING_SIZE;
prefetch(hw->st_le + hw->st_idx);
- BUG_ON(le->link >= hw->ports || !hw->dev[le->link]);
-
BUG_ON(le->link >= 2);
dev = hw->dev[le->link];
if (dev == NULL || !netif_running(dev))
@@ -1821,12 +1818,13 @@ static int sky2_poll(struct net_device *dev0, int *budget)
}
exit_loop:
+ sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ);
mmiowb();
sky2_tx_check(hw, 0, tx_done[0]);
sky2_tx_check(hw, 1, tx_done[1]);
- if (work_done < to_do) {
+ if (sky2_read16(hw, STAT_PUT_IDX) == hw->st_idx) {
/* need to restart TX timer */
if (is_ec_a1(hw)) {
sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_STOP);