]> git.proxmox.com Git - mirror_ubuntu-focal-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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Apr 2021 16:31:52 +0000 (18:31 +0200)
commit18f6f5b93f0da02ebf27152b1e7fc3dad16e94a4
treef6de214cbaea32bc100d5da33e3f771d18c7b5d7
parent9649dfdce7dcc73a9089bb773273001b1b31ffd9
can: tcan4x5x: tcan4x5x_init(): fix initialization - clear MRAM before entering Normal Mode

BugLink: https://bugs.launchpad.net/bugs/1920246
commit 2712625200ed69c642b9abc3a403830c4643364c upstream.

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: 5443c226ba91 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/net/can/m_can/tcan4x5x.c