lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 12 Oct 2022 08:25:54 +0200
From:   Matej Vasilevski <>
To:     Pavel Pisa <>,
        Ondrej Ille <>,
        Wolfgang Grandegger <>,
        Marc Kleine-Budde <>,
        "David S. Miller" <>,
        Eric Dumazet <>,
        Jakub Kicinski <>,
        Paolo Abeni <>,
        Rob Herring <>,
        Krzysztof Kozlowski <>
        Matej Vasilevski <>
Subject: [PATCH v5 0/4] can: ctucanfd: hardware rx timestamps reporting


this is the v5 patch for CTU CAN FD hardware timestamps reporting.

Changes since v4:
- removed the -clk suffix, as per Krzysztof's request on patch v3 review
- reverted changes to PM framework usage
	- also added dependency on PM to Kconfig
- added ctucan_remove_common() function to disable_unprepare timestamping clock
	on driver removal
- removed __maybe_unused - the fourth extra commit
- removed unnecessary bit masking of the read timestamp
- removed else branches after return
- removed ternary operators
- renamed timestamp_freq to timestamp_clk_rate
- removed unnecessary IS_ERR_OR_NULL() checks
- removed cfg.flags check to keep consistency with can_eth_ioctl_hwts()
- added lockdep_assert_held
- removed coupling to pm_enable_call variable
- increased the bit shift for work_delay_ns calculation from 1 to 2

Changes since v3:
- use pm_runtime_resume_and_get in error counter routine ctucan_get_berr_counter

Changes since v2:
- proper timestamping clock handling
	- clocks manually enabled using clk_prepare_enable, then managed
	  by runtime PM (if runtime PM is enabled)
	- driver should work even without CONFIG_PM
- access to the timecounter is now protected by a spinlock
- harmonized with Vincent's patch - TX timestamping capability is now
  correctly reported
- work_delay_jiffies stored as unsigned long instead of u32
- max work delay limited to 3600 seconds (instead of 86k seconds)
- adressed the rest of the comments from the patch V2 review

Changes since v1:
- Removed kconfig option to enable/disable timestamps.
- Removed dt parameters ts-frequency and ts-used-bits. Now the user
  only needs to add the timestamping clock phandle to clocks, and even
  that is optional.
- Added SIOCSHWTSTAMP ioctl to enable/disable timestamps.
- Adressed comments from the RFC review.

Matej Vasilevski (4):
  dt-bindings: can: ctucanfd: add another clock for HW timestamping
  can: ctucanfd: add HW timestamps to RX and error CAN frames
  doc: ctucanfd: RX frames timestamping for platform devices
  can: ctucanfd: remove __maybe_unused from suspend/resume callbacks

 .../bindings/net/can/ctu,ctucanfd.yaml        |  19 +-
 .../can/ctu/ctucanfd-driver.rst               |  13 +-
 drivers/net/can/ctucanfd/Kconfig              |   2 +-
 drivers/net/can/ctucanfd/Makefile             |   2 +-
 drivers/net/can/ctucanfd/ctucanfd.h           |  25 +-
 drivers/net/can/ctucanfd/ctucanfd_base.c      | 229 +++++++++++++++++-
 drivers/net/can/ctucanfd/ctucanfd_pci.c       |   7 +-
 drivers/net/can/ctucanfd/ctucanfd_platform.c  |   7 +-
 drivers/net/can/ctucanfd/ctucanfd_timestamp.c |  77 ++++++
 9 files changed, 361 insertions(+), 20 deletions(-)
 create mode 100644 drivers/net/can/ctucanfd/ctucanfd_timestamp.c

base-commit: 0326074ff4652329f2a1a9c8685104576bd8d131

Powered by blists - more mailing lists