Commit 2df6162
committed
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: d08e973 ("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>1 parent 6dfd65a commit 2df6162
1 file changed
Lines changed: 16 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
772 | 772 | | |
773 | 773 | | |
774 | 774 | | |
775 | | - | |
| 775 | + | |
776 | 776 | | |
777 | | - | |
778 | 777 | | |
779 | 778 | | |
780 | 779 | | |
| |||
791 | 790 | | |
792 | 791 | | |
793 | 792 | | |
794 | | - | |
| 793 | + | |
795 | 794 | | |
796 | | - | |
797 | 795 | | |
798 | 796 | | |
799 | 797 | | |
| |||
1057 | 1055 | | |
1058 | 1056 | | |
1059 | 1057 | | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
1060 | 1072 | | |
1061 | 1073 | | |
1062 | 1074 | | |
| |||
1370 | 1382 | | |
1371 | 1383 | | |
1372 | 1384 | | |
1373 | | - | |
1374 | 1385 | | |
1375 | 1386 | | |
1376 | 1387 | | |
| |||
1394 | 1405 | | |
1395 | 1406 | | |
1396 | 1407 | | |
1397 | | - | |
1398 | 1408 | | |
1399 | 1409 | | |
1400 | 1410 | | |
| |||
0 commit comments