Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

can: at91_can: RX queue could get stuck at high bus load

At high bus load it could happen that "at91_poll()" enters with all RX
message boxes filled up. If then at the end the "quota" is exceeded as
well, "rx_next" will not be reset to the first RX mailbox and hence the
interrupts remain disabled.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Tested-by: Amr Bekhit <amrbekhit@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

authored by

Wolfgang Grandegger and committed by
Marc Kleine-Budde
43200a44 427460c8

+3 -2
+3 -2
drivers/net/can/at91_can.c
··· 712 712 713 713 /* upper group completed, look again in lower */ 714 714 if (priv->rx_next > get_mb_rx_low_last(priv) && 715 - quota > 0 && mb > get_mb_rx_last(priv)) { 715 + mb > get_mb_rx_last(priv)) { 716 716 priv->rx_next = get_mb_rx_first(priv); 717 - goto again; 717 + if (quota > 0) 718 + goto again; 718 719 } 719 720 720 721 return received;