]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
can: gs_usb: gs_can_open(): always configure bitrates before starting device
authorMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 19 Feb 2026 12:57:34 +0000 (13:57 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 2 Mar 2026 10:09:36 +0000 (11:09 +0100)
commit2df6162785f31f1bbb598cfc3b08e4efc88f80b6
tree9021d6f5db8ce33d8f0c802b827f3183c8f18f38
parent6dfd65a69e69a00faadd80b709aea71b71f6967a
can: gs_usb: gs_can_open(): always configure bitrates before starting device

So far the driver populated the struct can_priv::do_set_bittiming() and
struct can_priv::fd::do_set_data_bittiming() callbacks.

Before bringing up the interface, user space has to configure the bitrates.
With these callbacks the configuration is directly forwarded into the CAN
hardware. Then the interface can be brought up.

An ifdown-ifup cycle (without changing the bit rates) doesn't re-configure
the bitrates in the CAN hardware. This leads to a problem with the
CANable-2.5 [1] firmware, which resets the configured bit rates during
ifdown.

To fix the problem remove both bit timing callbacks and always configure
the bitrates in the struct net_device_ops::ndo_open() callback.

[1] https://github.com/Elmue/CANable-2.5-firmware-Slcan-and-Candlelight

Cc: stable@vger.kernel.org
Fixes: d08e973a77d1 ("can: gs_usb: Added support for the GS_USB CAN devices")
Link: https://patch.msgid.link/20260219-gs_usb-always-configure-bitrates-v2-1-671f8ba5b0a5@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/usb/gs_usb.c