This is a note to let you know that I've just added the patch titled can: tcan4x5x: tcan4x5x_init(): fix initialization - clear MRAM before entering Normal Mode to the 5.11-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: can-tcan4x5x-tcan4x5x_init-fix-initialization-clear-mram-before-entering-normal-mode.patch and it can be found in the queue-5.11 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 2712625200ed69c642b9abc3a403830c4643364c Mon Sep 17 00:00:00 2001 From: Torin Cooper-Bennun <torin@xxxxxxxxxxxxxxxxxx> Date: Fri, 26 Feb 2021 16:34:41 +0000 Subject: can: tcan4x5x: tcan4x5x_init(): fix initialization - clear MRAM before entering Normal Mode From: Torin Cooper-Bennun <torin@xxxxxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxx Suggested-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx> Signed-off-by: Torin Cooper-Bennun <torin@xxxxxxxxxxxxxxxxxx> Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/net/can/m_can/tcan4x5x.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/net/can/m_can/tcan4x5x.c +++ b/drivers/net/can/m_can/tcan4x5x.c @@ -326,14 +326,14 @@ static int tcan4x5x_init(struct m_can_cl if (ret) return ret; + /* Zero out the MCAN buffers */ + m_can_init_ram(cdev); + ret = regmap_update_bits(tcan4x5x->regmap, TCAN4X5X_CONFIG, TCAN4X5X_MODE_SEL_MASK, TCAN4X5X_MODE_NORMAL); if (ret) return ret; - /* Zero out the MCAN buffers */ - m_can_init_ram(cdev); - return ret; } Patches currently in stable-queue which might be from torin@xxxxxxxxxxxxxxxxxx are queue-5.11/can-tcan4x5x-tcan4x5x_init-fix-initialization-clear-mram-before-entering-normal-mode.patch