can: c_can: c_can_poll(): only read status register after status IRQ
authorKurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
Tue, 1 Oct 2019 07:40:36 +0000 (09:40 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Nov 2019 18:20:44 +0000 (19:20 +0100)
commit7ae08111ca70d31813b26b12231793080da4b4e9
tree1dece3d2c5b39e8cc3f9b5e8fd2520d1eccd3c00
parent0327c7818da27b018464c0b9f541c5d276c57172
can: c_can: c_can_poll(): only read status register after status IRQ

commit 3cb3eaac52c0f145d895f4b6c22834d5f02b8569 upstream.

When the status register is read without the status IRQ pending, the
chip may not raise the interrupt line for an upcoming status interrupt
and the driver may miss a status interrupt.

It is critical that the BUSOFF status interrupt is forwarded to the
higher layers, since no more interrupts will follow without
intervention.

Thanks to Wolfgang and Joe for bringing up the first idea.

Signed-off-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
Cc: Wolfgang Grandegger <wg@grandegger.com>
Cc: Joe Burmeister <joe.burmeister@devtank.co.uk>
Fixes: fa39b54ccf28 ("can: c_can: Get rid of pointless interrupts")
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/c_can/c_can.c
drivers/net/can/c_can/c_can.h