Skip to content

can: kvaser_usb: Add hardware timestamp support to all devices

Jimmy Assarsson linux-can 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest15 patches 4 repliesIn review
  2. v115 patches 7 repliesSuperseded

Changes in v2 from the cover letter · 16 lines

- Replaced patch 3/15
can: kvaser_usb: Add function kvaser_usb_ticks_to_ktime()
with a new patch
can: kvaser_usb: Add helper functions to convert device timestamp into ktime
and put it first in this series
- Resolved Vincent MAILHOL's review comments regarding duplicated code when converting timestamps [2] [3]
- As pointed out by Vincent MAILHOL [4], the clock overflow commands is not
dispatched in this patch
moved code from 10/15
can: kvaser_usb: leaf: Add structs for Tx ACK and clock overflow commands
to 11/15
can: kvaser_usb: leaf: Store MSB of timestamp
where it's actually used

[2] https://lore.kernel.org/linux-can/CAMZ6RqKSa-6KjvgfmN9eL7A=A65gMkYsRrnaF41Azhsc45FA2Q@mail.gmail.com/
[3] https://lore.kernel.org/linux-can/CAMZ6Rq+Xd7+th=dKV+vrqzRtS+GY-xq2UziH1CURcQ3HxEXMqQ@mail.gmail.com/
[4] https://lore.kernel.org/linux-can/CAMZ6RqKqJX6eqogS2598BFm-AN1uOBbBGL+MkoJtR=-z379Q=w@mail.gmail.com/

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15can: kvaser_usb: Add helper functions to convert device timestamp into ktimedrivers/net/can/usb/kvaser_usb/kvaser_usb.h drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c+28 -62 replies
2/15can: kvaser_usb: hydra: kvaser_usb_hydra_ktime_from_rx_cmd: Drop {rx_} in function namedrivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c+4 -50 replies
3/15can: kvaser_usb: hydra: Add struct for Tx ACK commandsdrivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c+17 -20 replies
4/15can: kvaser_usb: hydra: Set hardware timestamp on transmitted packetsdrivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c+4 -10 replies
5/15can: kvaser_usb: leaf: Add struct for Tx ACK commandsdrivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c+9 -10 replies
6/15can: kvaser_usb: leaf: Assign correct timestamp_freq for kvaser_usb_leaf_imx_dev_cfg_{16,24,32}mhzdrivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c+3 -30 replies
7/15can: kvaser_usb: leaf: Replace kvaser_usb_leaf_m32c_dev_cfg with kvaser_usb_leaf_m32c_dev_cfg_{16,24,32}mhzdrivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c+30 -30 replies
8/15can: kvaser_usb: leaf: kvaser_usb_leaf_tx_acknowledge: Rename local variabledrivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c+4 -40 replies
9/15can: kvaser_usb: leaf: Add hardware timestamp support to leaf based devicesdrivers/net/can/usb/kvaser_usb/kvaser_usb_core.c drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c+22 -40 replies
10/15can: kvaser_usb: leaf: Add structs for Tx ACK and clock overflow commandsdrivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c+17 -20 replies
11/15can: kvaser_usb: leaf: Store MSB of timestampdrivers/net/can/usb/kvaser_usb/kvaser_usb.h drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c+9 -30 replies
12/15can: kvaser_usb: leaf: Add hardware timestamp support to usbcan devicesdrivers/net/can/usb/kvaser_usb/kvaser_usb_core.c drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c+14 -10 replies
13/15can: kvaser_usb: Remove KVASER_USB_QUIRK_HAS_HARDWARE_TIMESTAMPdrivers/net/can/usb/kvaser_usb/kvaser_usb.h drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c+8 -190 replies
14/15can: kvaser_usb: Remove struct variables kvaser_usb_{ethtool,netdev}_opsdrivers/net/can/usb/kvaser_usb/kvaser_usb_core.c+0 -110 replies
15/15can: kvaser_usb: Rename kvaser_usb_{ethtool,netdev}_ops_hwts to kvaser_usb_{ethtool,netdev}_opsdrivers/net/can/usb/kvaser_usb/kvaser_usb_core.c+4 -40 replies

Reviews trailers per patch

None of the 15 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchVincent Mailhol
SeriesR-b
1/15
2/15
3/15
4/15
5/15
6/15
7/15
8/15
9/15
10/15
11/15
12/15
13/15
14/15
15/15

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH can-next v2 00/15] can: kvaser_usb: Add hardware timestamp support to all devices

From: Jimmy Assarsson <[email protected]>

This patch series add hardware timestamp support to all devices supported by the kvaser_usb driver.

The first patches resolves a known issue; "Hardware timestamps are not set for CAN Tx frames". I can't remember why this wasn't implemented in the first version of the hydra driver.

Followed by, hardware timestamp support for leaf and usbcan based devices.

The final patches are removing code used for selecting the correct ethtool and netdev ops.

Note: This patch series depends on patch
"can: kvaser_usb: Explicitly initialize family in leafimx..." [1].

[1] https://lore.kernel.org/linux-can/[email protected]

Changes in v2:
- Replaced patch 3/15
can: kvaser_usb: Add function kvaser_usb_ticks_to_ktime()
with a new patch
can: kvaser_usb: Add helper functions to convert device timestamp into ktime
and put it first in this series
- Resolved Vincent MAILHOL's review comments regarding duplicated code when converting timestamps [2] [3]
- As pointed out by Vincent MAILHOL [4], the clock overflow commands is not
dispatched in this patch
moved code from 10/15
can: kvaser_usb: leaf: Add structs for Tx ACK and clock overflow commands
to 11/15
can: kvaser_usb: leaf: Store MSB of timestamp
where it's actually used

[2] https://lore.kernel.org/linux-can/CAMZ6RqKSa-6KjvgfmN9eL7A=A65gMkYsRrnaF41Azhsc45FA2Q@mail.gmail.com/
[3] https://lore.kernel.org/linux-can/CAMZ6Rq+Xd7+th=dKV+vrqzRtS+GY-xq2UziH1CURcQ3HxEXMqQ@mail.gmail.com/
[4] https://lore.kernel.org/linux-can/CAMZ6RqKqJX6eqogS2598BFm-AN1uOBbBGL+MkoJtR=-z379Q=w@mail.gmail.com/

Jimmy Assarsson (15):
can: kvaser_usb: Add helper functions to convert device timestamp into
ktime
can: kvaser_usb: hydra: kvaser_usb_hydra_ktime_from_rx_cmd: Drop {rx_}
in function name
can: kvaser_usb: hydra: Add struct for Tx ACK commands
can: kvaser_usb: hydra: Set hardware timestamp on transmitted packets
can: kvaser_usb: leaf: Add struct for Tx ACK commands
can: kvaser_usb: leaf: Assign correct timestamp_freq for

    kvaser_usb_leaf_imx_dev_cfg_{16,24,32}mhz
  can: kvaser_usb: leaf: Replace kvaser_usb_leaf_m32c_dev_cfg with
    kvaser_usb_leaf_m32c_dev_cfg_{16,24,32}mhz

can: kvaser_usb: leaf: kvaser_usb_leaf_tx_acknowledge: Rename local
variable
can: kvaser_usb: leaf: Add hardware timestamp support to leaf based
devices
can: kvaser_usb: leaf: Add structs for Tx ACK and clock overflow
commands
can: kvaser_usb: leaf: Store MSB of timestamp
can: kvaser_usb: leaf: Add hardware timestamp support to usbcan
devices
can: kvaser_usb: Remove KVASER_USB_QUIRK_HAS_HARDWARE_TIMESTAMP
can: kvaser_usb: Remove struct variables
kvaser_usb_{ethtool,netdev}_ops
can: kvaser_usb: Rename kvaser_usb_{ethtool,netdev}_ops_hwts to
kvaser_usb_{ethtool,netdev}_ops

 drivers/net/can/usb/kvaser_usb/kvaser_usb.h   |  26 +++-
 .../net/can/usb/kvaser_usb/kvaser_usb_core.c  |  21 +---
 .../net/can/usb/kvaser_usb/kvaser_usb_hydra.c |  41 +++++--
 .../net/can/usb/kvaser_usb/kvaser_usb_leaf.c  | 114 +++++++++++++++---
 4 files changed, 153 insertions(+), 49 deletions(-)
Signature · 1 line
2.45.2