]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
can: peak_usb: peak_usb_get_ts_time(): fix timestamp wrapping
authorStephane Grosjean <s.grosjean@peak-system.com>
Wed, 14 Oct 2020 08:56:31 +0000 (10:56 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Thu, 10 Dec 2020 11:06:13 +0000 (12:06 +0100)
commitc89cd3f8da217d7a20dd155f20ff1f8886e7f056
treeabd2325ae5fe82a7fc79ee37f80f41713cb6469c
parentcdc747890c4f9e32a6a12b3a356e562b340818d7
can: peak_usb: peak_usb_get_ts_time(): fix timestamp wrapping

BugLink: https://bugs.launchpad.net/bugs/1905618
[ Upstream commit ecc7b4187dd388549544195fb13a11b4ea8e6a84 ]

Fabian Inostroza <fabianinostrozap@gmail.com> has discovered a potential
problem in the hardware timestamp reporting from the PCAN-USB USB CAN interface
(only), related to the fact that a timestamp of an event may precede the
timestamp used for synchronization when both records are part of the same USB
packet. However, this case was used to detect the wrapping of the time counter.

This patch details and fixes the two identified cases where this problem can
occur.

Reported-by: Fabian Inostroza <fabianinostrozap@gmail.com>
Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com>
Link: https://lore.kernel.org/r/20201014085631.15128-1-s.grosjean@peak-system.com
Fixes: bb4785551f64 ("can: usb: PEAK-System Technik USB adapters driver core")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/net/can/usb/peak_usb/pcan_usb_core.c