Skip to content

Commit aa90be3

Browse files
chunkeeygregkh
authored andcommitted
net: emac: Fix napi poll list corruption
[ Upstream commit f55956065ec94e3e9371463d693a1029c4cc3007 ] 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 <chunkeey@googlemail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 3483c65 commit aa90be3

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

  • drivers/net/ethernet/ibm/emac

drivers/net/ethernet/ibm/emac/mal.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ static int mal_poll(struct napi_struct *napi, int budget)
402402
unsigned long flags;
403403

404404
MAL_DBG2(mal, "poll(%d)" NL, budget);
405-
again:
405+
406406
/* Process TX skbs */
407407
list_for_each(l, &mal->poll_list) {
408408
struct mal_commac *mc =
@@ -451,7 +451,6 @@ static int mal_poll(struct napi_struct *napi, int budget)
451451
spin_lock_irqsave(&mal->lock, flags);
452452
mal_disable_eob_irq(mal);
453453
spin_unlock_irqrestore(&mal->lock, flags);
454-
goto again;
455454
}
456455
mc->ops->poll_tx(mc->dev);
457456
}

0 commit comments

Comments
 (0)