Skip to contentSkip to conversation

can: ti_hecc: Fix napi poll return value for repoll

PATCH Applied Oliver Stäbler 2 participants 2 messages Nov 20, 2017 – Nov 27, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 can: ti_hecc: Fix napi poll return value for repoll

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.

---
 drivers/net/can/ti_hecc.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/can/ti_hecc.c +3 -0
index 4d4941469cfc..db6ea936dc3f 100644
@@ -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;
Signature · 1 line
2.13.6
maintainer Applied
#1 lore raw
Quoted 5 lines · Oliver Stäbler

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.

Applied to can.

Tnx,
Marc

Signature · 4 lines
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |