Skip to contentSkip to conversation

Thunderbolt/USB4 debugging tools

ANNOUNCE Mika Westerberg 3 participants 6 messages Apr 2, 2024 – May 2, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi all,

This is mostly for the folks developing and testing Thunderbolt/USB4 driver side of things but may be useful for others too. Not intented to replace anything we already have for the regular user stack.

In summary this is a collection of small tools that provide bit more user friendly access to the sysfs/debugfs/tracefs interfaces made available by the driver. Mainly useful for debugging issues around the software connection manager parts of the driver (although some of these work with the firmware connection manager too). We have been using this internally for a while.

The repository can be found here:

https://github.com/intel/tbtools

maintainer
#1 lore raw
Quoted 13 lines · Mika Westerberg

Hi all,

This is mostly for the folks developing and testing Thunderbolt/USB4 driver side of things but may be useful for others too. Not intented to replace anything we already have for the regular user stack.

In summary this is a collection of small tools that provide bit more user friendly access to the sysfs/debugfs/tracefs interfaces made available by the driver. Mainly useful for debugging issues around the software connection manager parts of the driver (although some of these work with the firmware connection manager too). We have been using this internally for a while.

Quoted 4 lines

The repository can be found here:

https://github.com/intel/tbtools

Very cool, thanks for the link!

greg k-h

#2 lore raw
Quoted 16 lines · Greg KH
Quoted 15 lines · Mika Westerberg

Hi all,

This is mostly for the folks developing and testing Thunderbolt/USB4 driver side of things but may be useful for others too. Not intented to replace anything we already have for the regular user stack.

In summary this is a collection of small tools that provide bit more user friendly access to the sysfs/debugfs/tracefs interfaces made available by the driver. Mainly useful for debugging issues around the software connection manager parts of the driver (although some of these work with the firmware connection manager too). We have been using this internally for a while.

The repository can be found here:

Quoted 7 lines
Quoted 2 lines

https://github.com/intel/tbtools

Very cool, thanks for the link!

greg k-h

Yes, thanks for sharing! Is it worth adding a link somewhere in kernel documentation to make it more discoverable?

#3 lore raw
Quoted 21 lines · Mario Limonciello
Quoted 20 lines · Greg KH
Quoted 17 lines · Mika Westerberg

Hi all,

This is mostly for the folks developing and testing Thunderbolt/USB4 driver side of things but may be useful for others too. Not intented to replace anything we already have for the regular user stack.

In summary this is a collection of small tools that provide bit more user friendly access to the sysfs/debugfs/tracefs interfaces made available by the driver. Mainly useful for debugging issues around the software connection manager parts of the driver (although some of these work with the firmware connection manager too). We have been using this internally for a while.

The repository can be found here:

https://github.com/intel/tbtools

Quoted 6 lines
Quoted 3 lines

Very cool, thanks for the link!

greg k-h

Yes, thanks for sharing! Is it worth adding a link somewhere in kernel documentation to make it more discoverable?

I can't think of any place where this could belong though since this is not meant for ordinary users (so I guess admin-guide is not good place for it either).

#4 lore raw
Quoted 24 lines · Mika Westerberg
Quoted 23 lines · Mario Limonciello
Quoted 22 lines · Greg KH
Quoted 13 lines · Mika Westerberg

Hi all,

This is mostly for the folks developing and testing Thunderbolt/USB4 driver side of things but may be useful for others too. Not intented to replace anything we already have for the regular user stack.

In summary this is a collection of small tools that provide bit more user friendly access to the sysfs/debugfs/tracefs interfaces made available by the driver. Mainly useful for debugging issues around the software connection manager parts of the driver (although some of these work with the firmware connection manager too). We have been using this internally for a while.

Quoted 4 lines

The repository can be found here:

https://github.com/intel/tbtools

Very cool, thanks for the link!

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

greg k-h

Yes, thanks for sharing! Is it worth adding a link somewhere in kernel documentation to make it more discoverable?

I can't think of any place where this could belong though since this is not meant for ordinary users (so I guess admin-guide is not good place for it either).

Well maybe as part of the Kconfig, something like below? Does that make sense?

drivers/thunderbolt/Kconfig +5 -1
index 279de1ba4487..0abdb69ee9f4 100644
@@ -22,7 +22,11 @@ config USB4_DEBUGFS_WRITE
 	bool "Enable write by debugfs to configuration spaces (DANGEROUS)"
 	help
 	  Enables writing to device configuration registers through
-	  debugfs interface.
+	  debugfs interface. You can use tools such as Thunderbolt/USB4
+	  debugging tools to access these registers. For more
+	  information see:
+
+	    https://github.com/intel/tbtools
 
 	  Only enable this if you know what you are doing! Never enable
 	  this for production systems or distro kernels.
Reviewed-by
#5 lore raw
Quoted 44 lines · Mika Westerberg
Quoted 24 lines · Mika Westerberg
Quoted 23 lines · Mario Limonciello
Quoted 22 lines · Greg KH
Quoted 13 lines · Mika Westerberg

Hi all,

This is mostly for the folks developing and testing Thunderbolt/USB4 driver side of things but may be useful for others too. Not intented to replace anything we already have for the regular user stack.

In summary this is a collection of small tools that provide bit more user friendly access to the sysfs/debugfs/tracefs interfaces made available by the driver. Mainly useful for debugging issues around the software connection manager parts of the driver (although some of these work with the firmware connection manager too). We have been using this internally for a while.

Quoted 4 lines

The repository can be found here:

https://github.com/intel/tbtools

Very cool, thanks for the link!

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

greg k-h

Yes, thanks for sharing! Is it worth adding a link somewhere in kernel documentation to make it more discoverable?

I can't think of any place where this could belong though since this is not meant for ordinary users (so I guess admin-guide is not good place for it either).

Well maybe as part of the Kconfig, something like below? Does that make sense?

drivers/thunderbolt/Kconfig +0 -0
index 279de1ba4487..0abdb69ee9f4 100644
@@ -22,7 +22,11 @@ config USB4_DEBUGFS_WRITE
  	bool "Enable write by debugfs to configuration spaces (DANGEROUS)"
  	help

drivers/thunderbolt/Kconfig config USB4_DEBUGFS_WRITE · line 32

Quoted 10 lines
drivers/thunderbolt/Kconfig +5 -1
  	  Enables writing to device configuration registers through
-	  debugfs interface.
+	  debugfs interface. You can use tools such as Thunderbolt/USB4
+	  debugging tools to access these registers. For more
+	  information see:
+
+	    https://github.com/intel/tbtools
 
  	  Only enable this if you know what you are doing! Never enable
  	  this for production systems or distro kernels.

WFM.

Feel free to tag this into the proper patch when you do it.