]> git.baikalelectronics.ru Git - kernel.git/commit
can: tcan4x5x: tcan4x5x_init(): fix initialization - clear MRAM before entering Norma...
authorTorin Cooper-Bennun <torin@maxiluxsystems.com>
Fri, 26 Feb 2021 16:34:41 +0000 (16:34 +0000)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 1 Mar 2021 10:45:15 +0000 (11:45 +0100)
commit981b7fdc099b793cea4b65271b332df63739cbd7
tree6ea04b92858aec265cfc486c670023f6f6617997
parent0bdc438b71c08510b515e9e571275625202c4e34
can: tcan4x5x: tcan4x5x_init(): fix initialization - clear MRAM before entering Normal Mode

This patch prevents a potentially destructive race condition. The
device is fully operational on the bus after entering Normal Mode, so
zeroing the MRAM after entering this mode may lead to loss of
information, e.g. new received messages.

This patch fixes the problem by first initializing the MRAM, then
bringing the device into Normale Mode.

Fixes: 727cb235a4a1 ("can: tcan4x5x: Add tcan4x5x driver to the kernel")
Link: https://lore.kernel.org/r/20210226163440.313628-1-torin@maxiluxsystems.com
Suggested-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Torin Cooper-Bennun <torin@maxiluxsystems.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/m_can/tcan4x5x-core.c