History log of /linux-6.15/drivers/thunderbolt/debugfs.c (Results 1 – 25 of 38)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: v6.15, v6.15-rc7, v6.15-rc6, v6.15-rc5, v6.15-rc4, v6.15-rc3, v6.15-rc2, v6.15-rc1, v6.14, v6.14-rc7, v6.14-rc6, v6.14-rc5, v6.14-rc4, v6.14-rc3, v6.14-rc2, v6.14-rc1, v6.13, v6.13-rc7, v6.13-rc6, v6.13-rc5, v6.13-rc4
# 43d84701 21-Dec-2024 Mika Westerberg <[email protected]>

thunderbolt: Expose router DROM through debugfs

Router DROM contains information that might be usable for development
and debugging purposes. For example when new entries are added to the
USB4 spec

thunderbolt: Expose router DROM through debugfs

Router DROM contains information that might be usable for development
and debugging purposes. For example when new entries are added to the
USB4 spec it is useful to be able to look for them without need to
change the kernel.

For this reason expose the DROM through debugfs.

Signed-off-by: Mika Westerberg <[email protected]>

show more ...


Revision tags: v6.13-rc3, v6.13-rc2, v6.13-rc1, v6.12
# 398da8e6 11-Nov-2024 Gil Fine <[email protected]>

thunderbolt: debugfs: Add write capability to path config space

Currently debugfs interface allows writing of router, adapter and
counters config spaces but not for paths. However, it can be useful

thunderbolt: debugfs: Add write capability to path config space

Currently debugfs interface allows writing of router, adapter and
counters config spaces but not for paths. However, it can be useful
during debugging to modify path config space so for this reason add this
support to the debugfs interface as well.

Signed-off-by: Gil Fine <[email protected]>
Signed-off-by: Mika Westerberg <[email protected]>

show more ...


Revision tags: v6.12-rc7, v6.12-rc6, v6.12-rc5, v6.12-rc4, v6.12-rc3, v6.12-rc2, v6.12-rc1, v6.11, v6.11-rc7, v6.11-rc6, v6.11-rc5, v6.11-rc4
# 916f26f1 15-Aug-2024 Aapo Vienamo <[email protected]>

thunderbolt: debugfs: Implement asymmetric lane margining

Add support for the RX2 receiver which is used as the third receiver in
asymmetric links. This requires expanding the results array for the

thunderbolt: debugfs: Implement asymmetric lane margining

Add support for the RX2 receiver which is used as the third receiver in
asymmetric links. This requires expanding the results array for the
additional third data word of the hardware margining results.

Signed-off-by: Aapo Vienamo <[email protected]>
Signed-off-by: Mika Westerberg <[email protected]>

show more ...


# 750365ef 15-Aug-2024 Aapo Vienamo <[email protected]>

thunderbolt: debugfs: Don't hardcode margining results size

Use ARRAY_SIZE() when available or pass in the array size derived from
it. This is in preparation for adding another result data word for

thunderbolt: debugfs: Don't hardcode margining results size

Use ARRAY_SIZE() when available or pass in the array size derived from
it. This is in preparation for adding another result data word for
supporting Gen 4 asymmetric links with an additional lane.

Signed-off-by: Aapo Vienamo <[email protected]>
Signed-off-by: Mika Westerberg <[email protected]>

show more ...


# 3499c0a9 15-Aug-2024 Aapo Vienamo <[email protected]>

thunderbolt: debugfs: Refactor hardware margining result parsing

Make the result parsing and formatting code less repetitive in
preparation for adding another result for Gen 4 asymmetric link suppor

thunderbolt: debugfs: Refactor hardware margining result parsing

Make the result parsing and formatting code less repetitive in
preparation for adding another result for Gen 4 asymmetric link support.

Signed-off-by: Aapo Vienamo <[email protected]>
Signed-off-by: Mika Westerberg <[email protected]>

show more ...


# 3bf090e9 15-Aug-2024 Aapo Vienamo <[email protected]>

thunderbolt: debugfs: Replace margining lane numbers with an enum

Replace the raw values and macros with an enum and use it consistently.
No functional changes.

Signed-off-by: Aapo Vienamo <aapo.vi

thunderbolt: debugfs: Replace margining lane numbers with an enum

Replace the raw values and macros with an enum and use it consistently.
No functional changes.

Signed-off-by: Aapo Vienamo <[email protected]>
Signed-off-by: Mika Westerberg <[email protected]>

show more ...


# e6c9905f 15-Aug-2024 Aapo Vienamo <[email protected]>

thunderbolt: debugfs: Replace "both lanes" with "all lanes"

With USB4 Gen 4, the link can be configured into an asymmetric mode,
where there are three receivers and only one transmitter. The USB4
sp

thunderbolt: debugfs: Replace "both lanes" with "all lanes"

With USB4 Gen 4, the link can be configured into an asymmetric mode,
where there are three receivers and only one transmitter. The USB4
specification also uses the "all lanes" nomenclature instead of "both
lanes".

Signed-off-by: Aapo Vienamo <[email protected]>
Signed-off-by: Mika Westerberg <[email protected]>

show more ...


# c8c08fd9 15-Aug-2024 Aapo Vienamo <[email protected]>

thunderbolt: debugfs: Implement Gen 4 margining eye selection

Add a debugfs knob for USB4 Gen 4 margining eye selection. Gen 4 uses
3-level pulse amplitude modulation (PAM3) which changes how margin

thunderbolt: debugfs: Implement Gen 4 margining eye selection

Add a debugfs knob for USB4 Gen 4 margining eye selection. Gen 4 uses
3-level pulse amplitude modulation (PAM3) which changes how margining
measurements are made because PAM3 has two eyes per lane from which
the margins can be measured.

Signed-off-by: Aapo Vienamo <[email protected]>
Signed-off-by: Mika Westerberg <[email protected]>

show more ...


# c9077d59 15-Aug-2024 Aapo Vienamo <[email protected]>

thunderbolt: debugfs: Add USB4 Gen 4 margining capabilities

Parse the Gen 4 specific capabilities. Change the return types of
independent_voltage_margins() and independent_time_margins() to enums
th

thunderbolt: debugfs: Add USB4 Gen 4 margining capabilities

Parse the Gen 4 specific capabilities. Change the return types of
independent_voltage_margins() and independent_time_margins() to enums
that distinguish between the Gen 2/3 and Gen 4 margins since they behave
differently between generations.

Signed-off-by: Aapo Vienamo <[email protected]>
Signed-off-by: Mika Westerberg <[email protected]>

show more ...


# 480ebc2e 15-Aug-2024 Aapo Vienamo <[email protected]>

thunderbolt: Don't hardcode margining capabilities size

Use or pass ARRAY_SIZE() of the capabilities array instead of hardcoding
it. USB4 Gen 4 introduces an additional data word, which requires
exp

thunderbolt: Don't hardcode margining capabilities size

Use or pass ARRAY_SIZE() of the capabilities array instead of hardcoding
it. USB4 Gen 4 introduces an additional data word, which requires
expanding the capabilities array.

Signed-off-by: Aapo Vienamo <[email protected]>
Signed-off-by: Mika Westerberg <[email protected]>

show more ...


Revision tags: v6.11-rc3, v6.11-rc2, v6.11-rc1
# 10904df3 19-Jul-2024 R Kannappan <[email protected]>

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 tim

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 <[email protected]>
Co-developed-by: Rene Sapiens <[email protected]>
Signed-off-by: Rene Sapiens <[email protected]>
Co-developed-by: Aapo Vienamo <[email protected]>
Signed-off-by: Aapo Vienamo <[email protected]>
Signed-off-by: Mika Westerberg <[email protected]>

show more ...


# 9fafd46b 19-Jul-2024 Rene Sapiens <[email protected]>

thunderbolt: Add optional voltage offset range for receiver lane margining

Add optional extended voltage offset range support for software and
hardware margining as defined by the USB4 specification

thunderbolt: Add optional voltage offset range for receiver lane margining

Add optional extended voltage offset range support for software and
hardware margining as defined by the USB4 specification.

If supported, it can be enabled like below:

# cd /sys/kernel/debug/thunderbolt/ROUTER/portX/margining/
# echo Y > optional_voltage_offset

Signed-off-by: Rene Sapiens <[email protected]>
Co-developed-by: R Kannappan <[email protected]>
Signed-off-by: R Kannappan <[email protected]>
Co-developed-by: Aapo Vienamo <[email protected]>
Signed-off-by: Aapo Vienamo <[email protected]>
Signed-off-by: Mika Westerberg <[email protected]>

show more ...


# 81f848d2 19-Jul-2024 Rene Sapiens <[email protected]>

thunderbolt: Consolidate margining parameters into a structure

Consolidate the hardware and software margining parameters into a single
structure to reduce the number of parameters passed to the mar

thunderbolt: Consolidate margining parameters into a structure

Consolidate the hardware and software margining parameters into a single
structure to reduce the number of parameters passed to the margining
functions.

Signed-off-by: Rene Sapiens <[email protected]>
Co-developed-by: Aapo Vienamo <[email protected]>
Signed-off-by: Aapo Vienamo <[email protected]>
Signed-off-by: Mika Westerberg <[email protected]>

show more ...


# 24edc397 19-Jul-2024 Aapo Vienamo <[email protected]>

thunderbolt: Add missing usb4_port_sb_read() to usb4_port_sw_margin()

Synchronize the operation completion by reading back the software
margining operation completion metadata into margining->result

thunderbolt: Add missing usb4_port_sb_read() to usb4_port_sw_margin()

Synchronize the operation completion by reading back the software
margining operation completion metadata into margining->results.

Signed-off-by: Aapo Vienamo <[email protected]>
Co-developed-by: R Kannappan <[email protected]>
Signed-off-by: R Kannappan <[email protected]>
Co-developed-by: Rene Sapiens <[email protected]>
Signed-off-by: Rene Sapiens <[email protected]>
Signed-off-by: Mika Westerberg <[email protected]>

show more ...


Revision tags: v6.10, v6.10-rc7, v6.10-rc6, v6.10-rc5
# ab3de2c7 20-Jun-2024 Aapo Vienamo <[email protected]>

thunderbolt: Fix memory leaks in {port|retimer}_sb_regs_write()

Add missing free_page() call for the memory allocated by
validate_and_copy_from_user().

Fixes: 6d241fa00159 ("thunderbolt: Add sideba

thunderbolt: Fix memory leaks in {port|retimer}_sb_regs_write()

Add missing free_page() call for the memory allocated by
validate_and_copy_from_user().

Fixes: 6d241fa00159 ("thunderbolt: Add sideband register access to debugfs")
Signed-off-by: Aapo Vienamo <[email protected]>
Reviewed-by: Przemek Kitszel <[email protected]>
Signed-off-by: Mika Westerberg <[email protected]>

show more ...


Revision tags: v6.10-rc4, v6.10-rc3, v6.10-rc2, v6.10-rc1
# 49056c95 21-May-2024 Aapo Vienamo <[email protected]>

thunderbolt: debugfs: Use FIELD_GET()

Use the FIELD_GET() macro instead of open coding the masks and shifts.
This makes the code more compact and improves readability as it avoids
the need to wrap e

thunderbolt: debugfs: Use FIELD_GET()

Use the FIELD_GET() macro instead of open coding the masks and shifts.
This makes the code more compact and improves readability as it avoids
the need to wrap excessively long lines.

Signed-off-by: Aapo Vienamo <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Reviewed-by: Yehezkel Bernat <[email protected]>
Signed-off-by: Mika Westerberg <[email protected]>

show more ...


Revision tags: v6.9, v6.9-rc7, v6.9-rc6, v6.9-rc5, v6.9-rc4, v6.9-rc3, v6.9-rc2, v6.9-rc1, v6.8, v6.8-rc7, v6.8-rc6, v6.8-rc5, v6.8-rc4, v6.8-rc3, v6.8-rc2, v6.8-rc1, v6.7, v6.7-rc8, v6.7-rc7, v6.7-rc6, v6.7-rc5, v6.7-rc4, v6.7-rc3, v6.7-rc2, v6.7-rc1, v6.6, v6.6-rc7, v6.6-rc6, v6.6-rc5, v6.6-rc4, v6.6-rc3, v6.6-rc2, v6.6-rc1, v6.5, v6.5-rc7, v6.5-rc6, v6.5-rc5, v6.5-rc4, v6.5-rc3, v6.5-rc2, v6.5-rc1, v6.4, v6.4-rc7, v6.4-rc6, v6.4-rc5, v6.4-rc4, v6.4-rc3, v6.4-rc2, v6.4-rc1, v6.3, v6.3-rc7, v6.3-rc6, v6.3-rc5, v6.3-rc4
# ff6ab055 21-Mar-2023 Mika Westerberg <[email protected]>

thunderbolt: Add receiver lane margining support for retimers

Retimers support lane margining as well so make this available through
debugfs in the same way as we do for the USB4 ports. When this is

thunderbolt: Add receiver lane margining support for retimers

Retimers support lane margining as well so make this available through
debugfs in the same way as we do for the USB4 ports. When this is
enabled we also expose retimers on the other side of the cable because
typically margining is implemented only on direction towards the cable.
However, for the retimers on the other side of the cable we do not allow
NVM upgrade to avoid confusing the existing userspace (the same retimer
may now appear twice with different name) and is probably not a good
idea anyway.

Signed-off-by: Mika Westerberg <[email protected]>

show more ...


# 0890fc36 21-Mar-2023 Mika Westerberg <[email protected]>

thunderbolt: Make margining functions accept target and retimer index

In order to add lane margining support for retimers make the margining
functions take sideband target and retimer index as param

thunderbolt: Make margining functions accept target and retimer index

In order to add lane margining support for retimers make the margining
functions take sideband target and retimer index as parameters. This
makes it possible to access both router and retimer sideband using the
same functions.

Signed-off-by: Mika Westerberg <[email protected]>

show more ...


Revision tags: v6.3-rc3
# ec6f888e 14-Mar-2023 Mika Westerberg <[email protected]>

thunderbolt: Split out margining from USB4 port

We are going to expand lane margining support for retimers too so split
out the generic margining functionality out of being specific to USB4
ports.

thunderbolt: Split out margining from USB4 port

We are going to expand lane margining support for retimers too so split
out the generic margining functionality out of being specific to USB4
ports.

Signed-off-by: Mika Westerberg <[email protected]>

show more ...


# 6d241fa0 20-Mar-2023 Mika Westerberg <[email protected]>

thunderbolt: Add sideband register access to debugfs

This makes it possible to read and write USB4 port and retimer sideband
registers through debugfs which is useful for debugging and manufacturing

thunderbolt: Add sideband register access to debugfs

This makes it possible to read and write USB4 port and retimer sideband
registers through debugfs which is useful for debugging and manufacturing
purposes. We add "sb_regs" debugfs attribute under each USB4 port and
retimer that is used to access the sideband.

Signed-off-by: Mika Westerberg <[email protected]>

show more ...


# 985cfe50 24-May-2024 Aapo Vienamo <[email protected]>

thunderbolt: debugfs: Fix margin debugfs node creation condition

The margin debugfs node controls the "Enable Margin Test" field of the
lane margining operations. This field selects between either l

thunderbolt: debugfs: Fix margin debugfs node creation condition

The margin debugfs node controls the "Enable Margin Test" field of the
lane margining operations. This field selects between either low or high
voltage margin values for voltage margin test or left or right timing
margin values for timing margin test.

According to the USB4 specification, whether or not the "Enable Margin
Test" control applies, depends on the values of the "Independent
High/Low Voltage Margin" or "Independent Left/Right Timing Margin"
capability fields for voltage and timing margin tests respectively. The
pre-existing condition enabled the debugfs node also in the case where
both low/high or left/right margins are returned, which is incorrect.
This change only enables the debugfs node in question, if the specific
required capability values are met.

Signed-off-by: Aapo Vienamo <[email protected]>
Fixes: d0f1e0c2a699 ("thunderbolt: Add support for receiver lane margining")
Cc: [email protected]
Signed-off-by: Mika Westerberg <[email protected]>

show more ...


# a3ad3a90 19-Apr-2024 Mika Westerberg <[email protected]>

thunderbolt: There are only 5 basic router registers in pre-USB4 routers

Intel pre-USB4 routers only have ROUTER_CS_0 up to ROUTER_CS_4 and it
immediately follows the TMU router registers. Correct t

thunderbolt: There are only 5 basic router registers in pre-USB4 routers

Intel pre-USB4 routers only have ROUTER_CS_0 up to ROUTER_CS_4 and it
immediately follows the TMU router registers. Correct this accordingly.

Reported-by: Rajaram Regupathy <[email protected]>
Signed-off-by: Mika Westerberg <[email protected]>

show more ...


# ac43c912 22-Nov-2023 Yaxiong Tian <[email protected]>

thunderbolt: Fix memory leak in margining_port_remove()

The dentry returned by debugfs_lookup() needs to be released by calling
dput() which is missing in margining_port_remove(). Fix this by callin

thunderbolt: Fix memory leak in margining_port_remove()

The dentry returned by debugfs_lookup() needs to be released by calling
dput() which is missing in margining_port_remove(). Fix this by calling
debugfs_lookup_and_remove() that combines both and avoids the memory leak.

Fixes: d0f1e0c2a699 ("thunderbolt: Add support for receiver lane margining")
Cc: [email protected]
Signed-off-by: Yaxiong Tian <[email protected]>
Signed-off-by: Mika Westerberg <[email protected]>

show more ...


Revision tags: v6.3-rc2, v6.3-rc1, v6.2, v6.2-rc8, v6.2-rc7, v6.2-rc6
# 0209c808 25-Jan-2023 Gil Fine <[email protected]>

thunderbolt: Fix PCIe adapter capability length for USB4 v2 routers

For USB4 v2 routers, the PCIe adapter capability length is longer.
Display the correct capability length in the debugfs register d

thunderbolt: Fix PCIe adapter capability length for USB4 v2 routers

For USB4 v2 routers, the PCIe adapter capability length is longer.
Display the correct capability length in the debugfs register dump.

Signed-off-by: Gil Fine <[email protected]>
Signed-off-by: Mika Westerberg <[email protected]>

show more ...


# 75abb4f5 25-Jan-2023 Gil Fine <[email protected]>

thunderbolt: Fix DisplayPort IN adapter capability length for USB4 v2 routers

For USB4 v2 routers, the DisplayPort IN adapter capability length is
longer. Display the correct capability length in th

thunderbolt: Fix DisplayPort IN adapter capability length for USB4 v2 routers

For USB4 v2 routers, the DisplayPort IN adapter capability length is
longer. Display the correct capability length in the debugfs register
dump.

Signed-off-by: Gil Fine <[email protected]>
Signed-off-by: Mika Westerberg <[email protected]>

show more ...


12