]> Gentwo Git Trees - linux/.git/commit
thunderbolt: Improve software receiver lane margining
authorR Kannappan <r.kannappan@intel.com>
Fri, 19 Jul 2024 18:37:20 +0000 (21:37 +0300)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Thu, 22 Aug 2024 04:32:06 +0000 (07:32 +0300)
commit10904df3f20cf36e418e78ab73c2fbcecda512b8
tree3e36f79b75e9bb891b6bc157856b2bbf893d5dcf
parent9fafd46b39d140b7359b77e5fcc4c3130788df42
thunderbolt: Improve software receiver lane margining

USB4 specification defines the metadata needed to perform software
margining, as well as the necessary steps which include waiting for
dwell time.

- Add dwell_time attribute to set the wait time while performing
  margining and checking for link errors.
- Add error_counter attribute to configure error counter prior to
  margining test.
- Add voltage_time_offset attribute to set the voltage or time offset
  steps before performing the software margining test.
- Perform software margining test for dwell duration, break if there are
  link errors, stop the clocks and provide results.

Below is a minimalistic example how this can be used. Note these values
are just examples. The exact values in practice depend on host specific
capabilities and the type of measurement to be performed.

  # cd /sys/kernel/debug/thunderbolt/ROUTER/portX/margining/
  # echo software > mode
  # echo 400 > dwell_time
  # echo 1 > run

As usual the results attribute contains the results of a succesfull run.

Signed-off-by: R Kannappan <r.kannappan@intel.com>
Co-developed-by: Rene Sapiens <rene.sapiens@intel.com>
Signed-off-by: Rene Sapiens <rene.sapiens@intel.com>
Co-developed-by: Aapo Vienamo <aapo.vienamo@linux.intel.com>
Signed-off-by: Aapo Vienamo <aapo.vienamo@linux.intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/thunderbolt/debugfs.c
drivers/thunderbolt/sb_regs.h
drivers/thunderbolt/tb.h
drivers/thunderbolt/usb4.c