]> git.itanic.dy.fi Git - linux-stable/commit
can: at91_can: at91_irq_err_line(): take reg_sr into account for bus off
authorMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 1 May 2023 16:14:41 +0000 (18:14 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 5 Oct 2023 19:47:22 +0000 (21:47 +0200)
commitf13e86993d85ac98b12159ca9e31dc0357e5a926
tree85fc90bfa1e803f86abb812fed6ba9ce871495e2
parent910f179aa0de17bab654291548aec378f74db293
can: at91_can: at91_irq_err_line(): take reg_sr into account for bus off

The at91 CAN controller automatically recovers from bus-off after 128
occurrences of 11 consecutive recessive bits.

After an auto-recovered bus-off, the error counters no longer reflect
this fact. On the sam9263 the state bits in the SR register show the
current state (based on the current error counters), while on sam9x5
and newer SoCs these bits are latched.

Take any latched bus-off information from the SR register into account
when calculating the CAN new state, to start the standard CAN bus off
handling.

Link: https://lore.kernel.org/all/20231005-at91_can-rx_offload-v2-23-9987d53600e0@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/at91_can.c