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:07:02 +0000 (20:07 +0100)
commit67e3a9f31a49977a7f53e6d7a93a174f6e6e0cb4
treedc33c582a6f7c76978680fa7e03d69372262e898
parent43fe49891deece87dea86422ed7e1f74115081ad
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