aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlistair Popple <alistair@popple.id.au>2013-10-29 19:50:37 -0400
committerDavid S. Miller <davem@davemloft.net>2013-10-29 22:57:42 -0400
commitb4dfd326c29c241c2bb8463167217eb2438b7c3d (patch)
treec1fdf53bb1cbacbc2f1da771d8625a51ff10b412
parentec9debbd9a88d8ea86c488d6ffcac419ee7d46d9 (diff)
ibm emac: Don't call napi_complete if napi_reschedule failed
This patch fixes a bug which would trigger the BUG_ON() at net/core/dev.c:4156. It was found that this was due to continuing processing in the current poll call even when the call to napi_reschedule failed, indicating the device was already on the polling list. This resulted in an extra call to napi_complete which triggered the BUG_ON(). This patch ensures that we only contine processing rotting packets in the current mal_poll call if we are not already on the polling list. Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/ibm/emac/mal.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/net/ethernet/ibm/emac/mal.c b/drivers/net/ethernet/ibm/emac/mal.c
index dac564c25440..909f9b6698b5 100644
--- a/drivers/net/ethernet/ibm/emac/mal.c
+++ b/drivers/net/ethernet/ibm/emac/mal.c
@@ -442,15 +442,11 @@ static int mal_poll(struct napi_struct *napi, int budget)
442 if (unlikely(mc->ops->peek_rx(mc->dev) || 442 if (unlikely(mc->ops->peek_rx(mc->dev) ||
443 test_bit(MAL_COMMAC_RX_STOPPED, &mc->flags))) { 443 test_bit(MAL_COMMAC_RX_STOPPED, &mc->flags))) {
444 MAL_DBG2(mal, "rotting packet" NL); 444 MAL_DBG2(mal, "rotting packet" NL);
445 if (napi_reschedule(napi)) 445 if (!napi_reschedule(napi))
446 mal_disable_eob_irq(mal);
447 else
448 MAL_DBG2(mal, "already in poll list" NL);
449
450 if (budget > 0)
451 goto again;
452 else
453 goto more_work; 446 goto more_work;
447
448 mal_disable_eob_irq(mal);
449 goto again;
454 } 450 }
455 mc->ops->poll_tx(mc->dev); 451 mc->ops->poll_tx(mc->dev);
456 } 452 }