diff mbox series

can: ti_hecc: Fix napi poll return value for repoll

Message ID 20171120134515.2658-1-oliver.staebler@bytesatwork.ch
State Awaiting Upstream, archived
Delegated to: David Miller
Headers show
Series can: ti_hecc: Fix napi poll return value for repoll | expand

Commit Message

Oliver Stäbler Nov. 20, 2017, 1:45 p.m. UTC
After commit d75b1ade567f ("net: less interrupt masking in NAPI") napi
repoll is done only when work_done == budget.
So we need to return budget if there are still packets to receive.

Signed-off-by: Oliver Stäbler <oliver.staebler@bytesatwork.ch>
---
 drivers/net/can/ti_hecc.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Marc Kleine-Budde Nov. 27, 2017, 2:18 p.m. UTC | #1
On 11/20/2017 02:45 PM, Oliver Stäbler wrote:
> After commit d75b1ade567f ("net: less interrupt masking in NAPI") napi
> repoll is done only when work_done == budget.
> So we need to return budget if there are still packets to receive.
> 
> Signed-off-by: Oliver Stäbler <oliver.staebler@bytesatwork.ch>

Applied to can.

Tnx,
Marc
diff mbox series

Patch

diff --git a/drivers/net/can/ti_hecc.c b/drivers/net/can/ti_hecc.c
index 4d4941469cfc..db6ea936dc3f 100644
--- a/drivers/net/can/ti_hecc.c
+++ b/drivers/net/can/ti_hecc.c
@@ -637,6 +637,9 @@  static int ti_hecc_rx_poll(struct napi_struct *napi, int quota)
 		mbx_mask = hecc_read(priv, HECC_CANMIM);
 		mbx_mask |= HECC_TX_MBOX_MASK;
 		hecc_write(priv, HECC_CANMIM, mbx_mask);
+	} else {
+		/* repoll is done only if whole budget is used */
+		num_pkts = quota;
 	}
 
 	return num_pkts;