aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2014-03-27 14:09:02 +0100
committerSteven Rostedt <rostedt@rostedt.homelinux.com>2014-04-30 12:13:09 -0400
commitb761bd966b1d92db84ec9dbf8afc979040f8cc14 (patch)
treec2e0d27b6cea9df03e86b918b3ada614a7332373
parentccf208749749556cfb26cc6bc7e176eaf6fac261 (diff)
net: gianfar: do not try to cleanup TX packets if they are not done
What I observe is that the TX queue is not empty and does not make any progress. gfar_clean_tx_ring() does not clean up the packet because it is not completed yet. The root cause is that the DMA engine did not start yet (it was preempted before doing so) and that dumb loop, loops until that packet is gone. This is broken since c233cf4 ("gianfar: Fix tx napi polling"). What remains are spurious interrupts if CPU0 cleans up TX packages and CPU1 returns with IRQ_NONE. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> [ added return howmany; ] Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--drivers/net/ethernet/freescale/gianfar.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index 5c0efcce2abc..b87a8c919c3e 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -132,7 +132,6 @@ static int gfar_poll(struct napi_struct *napi, int budget);
static void gfar_netpoll(struct net_device *dev);
#endif
int gfar_clean_rx_ring(struct gfar_priv_rx_q *rx_queue, int rx_work_limit);
-static void gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue);
static void gfar_process_frame(struct net_device *dev, struct sk_buff *skb,
int amount_pull, struct napi_struct *napi);
void gfar_halt(struct net_device *dev);
@@ -2475,7 +2474,7 @@ static void gfar_align_skb(struct sk_buff *skb)
}
/* Interrupt Handler for Transmit complete */
-static void gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue)
+static int gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue)
{
struct net_device *dev = tx_queue->dev;
struct netdev_queue *txq;
@@ -2575,6 +2574,7 @@ static void gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue)
tx_queue->dirty_tx = bdp;
netdev_tx_completed_queue(txq, howmany, bytes_sent);
+ return howmany;
}
static void gfar_schedule_cleanup(struct gfar_priv_grp *gfargrp)
@@ -2856,10 +2856,14 @@ static int gfar_poll(struct napi_struct *napi, int budget)
tx_queue = priv->tx_queue[i];
/* run Tx cleanup to completion */
if (tx_queue->tx_skbuff[tx_queue->skb_dirtytx]) {
- gfar_clean_tx_ring(tx_queue);
- has_tx_work = 1;
+ int ret;
+
+ ret = gfar_clean_tx_ring(tx_queue);
+ if (ret)
+ has_tx_work++;
}
}
+ work_done += has_tx_work;
for_each_set_bit(i, &gfargrp->rx_bit_map, priv->num_rx_queues) {
/* skip queue if not active */