can: mscan: mscan_rx_poll(): fix rx path lockup when returning from polling to irq...
authorFlorian Faber <faber@faberman.de>
Thu, 26 Dec 2019 18:51:24 +0000 (19:51 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jan 2020 19:08:27 +0000 (20:08 +0100)
commit584b8299f7250b69396138823b5a94f33016340f
treee4c85c7b64ebb76b0c966a0be53516087a65c036
parent1ad3ee211d331cdc60260952c3b3c61ddda4ed64
can: mscan: mscan_rx_poll(): fix rx path lockup when returning from polling to irq mode

commit 2d77bd61a2927be8f4e00d9478fe6996c47e8d45 upstream.

Under load, the RX side of the mscan driver can get stuck while TX still
works. Restarting the interface locks up the system. This behaviour
could be reproduced reliably on a MPC5121e based system.

The patch fixes the return value of the NAPI polling function (should be
the number of processed packets, not constant 1) and the condition under
which IRQs are enabled again after polling is finished.

With this patch, no more lockups were observed over a test period of ten
days.

Fixes: afa17a500a36 ("net/can: add driver for mscan family & mpc52xx_mscan")
Signed-off-by: Florian Faber <faber@faberman.de>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/can/mscan/mscan.c