summaryrefslogtreecommitdiffstats
path: root/drivers/net/can/ti_hecc.c
diff options
context:
space:
mode:
authorOliver Stäbler <oliver.staebler@bytesatwork.ch>2017-11-20 14:45:15 +0100
committerMarc Kleine-Budde <mkl@pengutronix.de>2017-12-01 11:20:52 +0100
commitf6c23b174c3c96616514827407769cbcfc8005cf (patch)
tree3e057f9a641e9aab867505bb1af06552efb7ce5d /drivers/net/can/ti_hecc.c
parentcan: kvaser_usb: ratelimit errors if incomplete messages are received (diff)
downloadlinux-f6c23b174c3c96616514827407769cbcfc8005cf.tar.xz
linux-f6c23b174c3c96616514827407769cbcfc8005cf.zip
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. Signed-off-by: Oliver Stäbler <oliver.staebler@bytesatwork.ch> Cc: linux-stable <stable@vger.kernel.org> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can/ti_hecc.c')
-rw-r--r--drivers/net/can/ti_hecc.c3
1 files changed, 3 insertions, 0 deletions
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;