Commit 559bcac3 authored by David S. Miller's avatar David S. Miller

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 7dbb4918
   ("r8169: avoid NAPI scheduling delay.") made to fix the same
   problem in the r8169 driver.  From Francois Romieu.
Reported-by: default avatarJamie Gloudon <jamie.gloudon@gmail.com>
Tested-by: default avatarJamie Gloudon <jamie.gloudon@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9165bf27
...@@ -1801,7 +1801,7 @@ static void rhine_tx(struct net_device *dev) ...@@ -1801,7 +1801,7 @@ static void rhine_tx(struct net_device *dev)
rp->tx_skbuff[entry]->len, rp->tx_skbuff[entry]->len,
PCI_DMA_TODEVICE); PCI_DMA_TODEVICE);
} }
dev_kfree_skb_irq(rp->tx_skbuff[entry]); dev_kfree_skb(rp->tx_skbuff[entry]);
rp->tx_skbuff[entry] = NULL; rp->tx_skbuff[entry] = NULL;
entry = (++rp->dirty_tx) % TX_RING_SIZE; entry = (++rp->dirty_tx) % TX_RING_SIZE;
} }
...@@ -2010,11 +2010,7 @@ static void rhine_slow_event_task(struct work_struct *work) ...@@ -2010,11 +2010,7 @@ static void rhine_slow_event_task(struct work_struct *work)
if (intr_status & IntrPCIErr) if (intr_status & IntrPCIErr)
netif_warn(rp, hw, dev, "PCI error\n"); netif_warn(rp, hw, dev, "PCI error\n");
napi_disable(&rp->napi); iowrite16(RHINE_EVENT & 0xffff, rp->base + IntrEnable);
rhine_irq_disable(rp);
/* Slow and safe. Consider __napi_schedule as a replacement ? */
napi_enable(&rp->napi);
napi_schedule(&rp->napi);
out_unlock: out_unlock:
mutex_unlock(&rp->task_lock); mutex_unlock(&rp->task_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment