linux-stable/drivers/net/can/sja1000
Miquel Raynal 717c6ec241 can: sja1000: Prevent overrun stalls with a soft reset on Renesas SoCs
In their RZN1 SoC, Renesas put a CAN controller supposed to act very
similarly to the original Philips sja1000. In practice, while flooding
the bus with another device, we discovered that the controller very
often after an overrun situation would just refuse any new frame, drop
them all and trigger over and over again the overrun interrupt, even
though the buffer would have been totally emptied. The controller acts
like if its internal buffer offsets (where it writes and where the host
reads) where totally screwed-up.

Renesas manual mentions a single action to perform in order to
resynchronize the read and write offsets within the buffer: performing
a soft reset.

Performing a soft reset takes a bit of time and involves small delays,
so better do that in a threaded handler rather than inside the hard IRQ
handler.

Add platform data to recognize the platforms which need this workaround,
and when the faulty situation is diagnosed, stop what is being
performed and request the threaded handler to be executed in order to
perform the reset.

Tested-by: Jérémie Dautheribes  <jeremie.dautheribes@bootlin.com> # 5.10
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/all/20230616134553.2786391-2-miquel.raynal@bootlin.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2023-06-22 09:41:32 +02:00
..
Kconfig can: Fix Links to Technologic Systems web resources 2022-04-19 17:12:12 +02:00
Makefile can: sja1000: f81601: add Fintek F81601 support 2019-07-24 10:30:37 +02:00
ems_pci.c can: ems_pci: Add myself as module author 2023-02-02 17:33:53 +01:00
ems_pcmcia.c can: sja1000: fix use after free in ems_pcmcia_add_card() 2021-12-07 09:08:58 +01:00
f81601.c can: sja1000: f81601: remove unused including <linux/version.h> 2019-08-13 16:37:03 +02:00
kvaser_pci.c module: remove never implemented MODULE_SUPPORTED_DEVICE 2021-03-17 13:16:18 -07:00
peak_pci.c can: peak_pci: peak_pci_remove(): fix UAF 2021-10-17 22:51:50 +02:00
peak_pcmcia.c net: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:07 -07:00
plx_pci.c module: remove never implemented MODULE_SUPPORTED_DEVICE 2021-03-17 13:16:18 -07:00
sja1000.c can: sja1000: Prevent overrun stalls with a soft reset on Renesas SoCs 2023-06-22 09:41:32 +02:00
sja1000.h can: sja1000: Prevent overrun stalls with a soft reset on Renesas SoCs 2023-06-22 09:41:32 +02:00
sja1000_isa.c can: sja1000_isa: Convert to platform remove callback returning void 2023-05-15 22:53:51 +02:00
sja1000_platform.c can: sja1000: Prevent overrun stalls with a soft reset on Renesas SoCs 2023-06-22 09:41:32 +02:00
tscan1.c can: Fix Links to Technologic Systems web resources 2022-04-19 17:12:12 +02:00