diff options
author | David S. Miller <davem@davemloft.net> | 2013-01-29 22:58:04 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-02-02 22:58:25 -0500 |
commit | 559bcac35facfed49ab4f408e162971612dcfdf3 (patch) | |
tree | a575a9c9014943a1cab0fc3dcb8a3d0f87202175 | |
parent | 9165bf273e862c993f36aff0c149259faa72540d (diff) |
via-rhine: Fix bugs in NAPI support.
1) rhine_tx() should use dev_kfree_skb() not dev_kfree_skb_irq()
2) rhine_slow_event_task's NAPI triggering logic is racey, it
should just hit the interrupt mask register. This is the
same as commit 7dbb491878a2c51d372a8890fa45a8ff80358af1
("r8169: avoid NAPI scheduling delay.") made to fix the same
problem in the r8169 driver. From Francois Romieu.
Reported-by: Jamie Gloudon <jamie.gloudon@gmail.com>
Tested-by: Jamie Gloudon <jamie.gloudon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/via/via-rhine.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/net/ethernet/via/via-rhine.c b/drivers/net/ethernet/via/via-rhine.c index 7992b3e05d3d..78ace59efd29 100644 --- a/drivers/net/ethernet/via/via-rhine.c +++ b/drivers/net/ethernet/via/via-rhine.c | |||
@@ -1801,7 +1801,7 @@ static void rhine_tx(struct net_device *dev) | |||
1801 | rp->tx_skbuff[entry]->len, | 1801 | rp->tx_skbuff[entry]->len, |
1802 | PCI_DMA_TODEVICE); | 1802 | PCI_DMA_TODEVICE); |
1803 | } | 1803 | } |
1804 | dev_kfree_skb_irq(rp->tx_skbuff[entry]); | 1804 | dev_kfree_skb(rp->tx_skbuff[entry]); |
1805 | rp->tx_skbuff[entry] = NULL; | 1805 | rp->tx_skbuff[entry] = NULL; |
1806 | entry = (++rp->dirty_tx) % TX_RING_SIZE; | 1806 | entry = (++rp->dirty_tx) % TX_RING_SIZE; |
1807 | } | 1807 | } |
@@ -2010,11 +2010,7 @@ static void rhine_slow_event_task(struct work_struct *work) | |||
2010 | if (intr_status & IntrPCIErr) | 2010 | if (intr_status & IntrPCIErr) |
2011 | netif_warn(rp, hw, dev, "PCI error\n"); | 2011 | netif_warn(rp, hw, dev, "PCI error\n"); |
2012 | 2012 | ||
2013 | napi_disable(&rp->napi); | 2013 | iowrite16(RHINE_EVENT & 0xffff, rp->base + IntrEnable); |
2014 | rhine_irq_disable(rp); | ||
2015 | /* Slow and safe. Consider __napi_schedule as a replacement ? */ | ||
2016 | napi_enable(&rp->napi); | ||
2017 | napi_schedule(&rp->napi); | ||
2018 | 2014 | ||
2019 | out_unlock: | 2015 | out_unlock: |
2020 | mutex_unlock(&rp->task_lock); | 2016 | mutex_unlock(&rp->task_lock); |