linux-stable/drivers/net/can
Marc Kleine-Budde 29a8c9ec90 can: gs_usb: add missing lock to protect struct timecounter::cycle_last
The struct timecounter::cycle_last is a 64 bit variable, read by
timecounter_cyc2time(), and written by timecounter_read(). On 32 bit
architectures this is not atomic.

Add a spinlock to protect access to struct timecounter::cycle_last. In
the gs_usb_timestamp_read() callback the lock is dropped to execute a
sleeping synchronous USB transfer. This is safe, as the variable we
want to protect is accessed during this call.

Fixes: 45dfa45f52 ("can: gs_usb: add RX and TX hardware timestamp support")
Link: https://lore.kernel.org/all/20220920100416.959226-3-mkl@pengutronix.de
Cc: John Whittington <git@jbrengineering.co.uk>
Tested-by: John Whittington <git@jbrengineering.co.uk>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2022-09-23 13:55:00 +02:00
..
c_can can: tree-wide: advertise software timestamping capabilities 2022-07-28 11:44:01 +02:00
cc770 can: tree-wide: advertise software timestamping capabilities 2022-07-28 11:44:01 +02:00
ctucanfd can: set CANFD_FDF flag in all CAN FD frame structures 2022-09-15 09:08:08 +02:00
dev can: canxl: update CAN infrastructure for CAN XL frames 2022-09-15 09:08:09 +02:00
flexcan Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-09-22 13:02:10 -07:00
ifi_canfd can: tree-wide: advertise software timestamping capabilities 2022-07-28 11:44:01 +02:00
m_can can: tree-wide: advertise software timestamping capabilities 2022-07-28 11:44:01 +02:00
mscan powerpc updates for 6.0 2022-08-06 16:38:17 -07:00
peak_canfd can: peak_canfd: advertise timestamping capabilities and add ioctl support 2022-07-28 11:44:31 +02:00
rcar can: rcar_canfd: Use dev_err_probe() to simplify code and better handle -EPROBE_DEFER 2022-09-05 22:00:42 +02:00
sja1000 can: sja1000: remove redundant variable ret 2022-09-05 22:00:43 +02:00
slcan can: tree-wide: advertise software timestamping capabilities 2022-07-28 11:44:01 +02:00
softing can: tree-wide: advertise software timestamping capabilities 2022-07-28 11:44:01 +02:00
spi can: mcp251x: Fix race condition on receive interrupt 2022-08-09 21:40:22 +02:00
usb can: gs_usb: add missing lock to protect struct timecounter::cycle_last 2022-09-23 13:55:00 +02:00
at91_can.c can: tree-wide: advertise software timestamping capabilities 2022-07-28 11:44:01 +02:00
can327.c can: can327: fix a broken link to Documentation 2022-07-31 20:53:50 +02:00
grcan.c can: tree-wide: advertise software timestamping capabilities 2022-07-28 11:44:01 +02:00
janz-ican3.c can: tree-wide: advertise software timestamping capabilities 2022-07-28 11:44:01 +02:00
Kconfig can: slcan: use CAN network device driver API 2022-07-03 11:34:28 +02:00
kvaser_pciefd.c can: kvaser_pciefd: remove redundant variable ret 2022-09-05 22:00:43 +02:00
Makefile can: slcan: move driver into separate sub directory 2022-07-03 11:34:44 +02:00
pch_can.c can: tree-wide: advertise software timestamping capabilities 2022-07-28 11:44:01 +02:00
sun4i_can.c can: tree-wide: advertise software timestamping capabilities 2022-07-28 11:44:01 +02:00
ti_hecc.c SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
vcan.c can: dev: add CAN XL support to virtual CAN 2022-09-15 09:08:09 +02:00
vxcan.c can: dev: add CAN XL support to virtual CAN 2022-09-15 09:08:09 +02:00
xilinx_can.c can: tree-wide: advertise software timestamping capabilities 2022-07-28 11:44:01 +02:00