Skip to content

Commit

Permalink
net: emac: Fix napi poll list corruption
Browse files Browse the repository at this point in the history
This patch is pretty much a carbon copy of
commit 3079c65 ("caif: Fix napi poll list corruption")
with "caif" replaced by "emac".

The commit d75b1ad ("net: less interrupt masking in NAPI")
breaks emac.

It is now required that if the entire budget is consumed when poll
returns, the napi poll_list must remain empty.  However, like some
other drivers emac tries to do a last-ditch check and if there is
more work it will call napi_reschedule and then immediately process
some of this new work.  Should the entire budget be consumed while
processing such new work then we will violate the new caller
contract.

This patch fixes this by not touching any work when we reschedule
in emac.

Signed-off-by: Christian Lamparter <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
chunkeey authored and davem330 committed Sep 19, 2017
1 parent b5b7db8 commit f559560
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/ethernet/ibm/emac/mal.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ static int mal_poll(struct napi_struct *napi, int budget)
unsigned long flags;

MAL_DBG2(mal, "poll(%d)" NL, budget);
again:

/* Process TX skbs */
list_for_each(l, &mal->poll_list) {
struct mal_commac *mc =
Expand Down Expand Up @@ -451,7 +451,6 @@ static int mal_poll(struct napi_struct *napi, int budget)
spin_lock_irqsave(&mal->lock, flags);
mal_disable_eob_irq(mal);
spin_unlock_irqrestore(&mal->lock, flags);
goto again;
}
mc->ops->poll_tx(mc->dev);
}
Expand Down

0 comments on commit f559560

Please sign in to comment.