This is a note to let you know that I've just added the patch titled can: kvaser_usb_leaf: Fix CAN state after restart to the 5.10-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-kvaser_usb_leaf-fix-can-state-after-restart.patch and it can be found in the queue-5.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 0be1a655fe68c8e6dcadbcbddb69cf2fb29881f5 Mon Sep 17 00:00:00 2001 From: Anssi Hannula <anssi.hannula@xxxxxxxxxx> Date: Mon, 10 Oct 2022 17:08:29 +0200 Subject: can: kvaser_usb_leaf: Fix CAN state after restart From: Anssi Hannula <anssi.hannula@xxxxxxxxxx> commit 0be1a655fe68c8e6dcadbcbddb69cf2fb29881f5 upstream. can_restart() expects CMD_START_CHIP to set the error state to ERROR_ACTIVE as it calls netif_carrier_on() immediately afterwards. Otherwise the user may immediately trigger restart again and hit a BUG_ON() in can_restart(). Fix kvaser_usb_leaf set_mode(CMD_START_CHIP) to set the expected state. Cc: stable@xxxxxxxxxxxxxxx Fixes: 080f40a6fa28 ("can: kvaser_usb: Add support for Kvaser CAN/USB devices") Tested-by: Jimmy Assarsson <extja@xxxxxxxxxx> Signed-off-by: Anssi Hannula <anssi.hannula@xxxxxxxxxx> Signed-off-by: Jimmy Assarsson <extja@xxxxxxxxxx> Link: https://lore.kernel.org/all/20221010150829.199676-5-extja@xxxxxxxxxx Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c +++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c @@ -1435,6 +1435,8 @@ static int kvaser_usb_leaf_set_mode(stru err = kvaser_usb_leaf_simple_cmd_async(priv, CMD_START_CHIP); if (err) return err; + + priv->can.state = CAN_STATE_ERROR_ACTIVE; break; default: return -EOPNOTSUPP; Patches currently in stable-queue which might be from anssi.hannula@xxxxxxxxxx are queue-5.10/can-kvaser_usb_leaf-fix-overread-with-an-invalid-command.patch queue-5.10/can-kvaser_usb_leaf-fix-can-state-after-restart.patch queue-5.10/can-kvaser_usb-fix-use-of-uninitialized-completion.patch queue-5.10/can-kvaser_usb_leaf-fix-tx-queue-out-of-sync-after-restart.patch