summaryrefslogtreecommitdiffstats
path: root/drivers/thunderbolt/Kconfig
diff options
context:
space:
mode:
authorGil Fine <gil.fine@intel.com>2020-06-29 19:30:52 +0200
committerMika Westerberg <mika.westerberg@linux.intel.com>2020-09-03 11:21:08 +0200
commit54e418106c765c5f3c378c770b0f8518632830da (patch)
treebb1305f173bab24b167142eef3d5eee5a58abeed /drivers/thunderbolt/Kconfig
parentthunderbolt: No need to warn in TB_CFG_ERROR_INVALID_CONFIG_SPACE (diff)
downloadlinux-54e418106c765c5f3c378c770b0f8518632830da.tar.xz
linux-54e418106c765c5f3c378c770b0f8518632830da.zip
thunderbolt: Add debugfs interface
This adds debugfs interface that can be used for debugging possible issues in hardware/software. It exposes router and adapter config spaces through files like this: /sys/kernel/debug/thunderbolt/<DEVICE>/regs /sys/kernel/debug/thunderbolt/<DEVICE>/<PORT1>/regs /sys/kernel/debug/thunderbolt/<DEVICE>/<PORT1>/path /sys/kernel/debug/thunderbolt/<DEVICE>/<PORT1>/counters /sys/kernel/debug/thunderbolt/<DEVICE>/<PORT2>/regs /sys/kernel/debug/thunderbolt/<DEVICE>/<PORT2>/path /sys/kernel/debug/thunderbolt/<DEVICE>/<PORT2>/counters ... The "regs" is either the router or port configuration space register dump. The "path" is the port path configuration space and "counters" is the optional counters configuration space. These files contains one register per line so it should be easy to use normal filtering tools to find the registers of interest if needed. The router and adapter regs file becomes writable when CONFIG_USB4_DEBUGFS_WRITE is enabled (which is not supposed to be done in production systems) and in this case the developer can write "offset value" lines there to modify the hardware directly. For convenience this also supports the long format the read side produces (but ignores the additional fields). The counters file can be written even when CONFIG_USB4_DEBUGFS_WRITE is not enabled and it is only used to clear the counter values. Signed-off-by: Gil Fine <gil.fine@intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/thunderbolt/Kconfig')
-rw-r--r--drivers/thunderbolt/Kconfig10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/thunderbolt/Kconfig b/drivers/thunderbolt/Kconfig
index 354e61c0f2e5..2257c22f8ab3 100644
--- a/drivers/thunderbolt/Kconfig
+++ b/drivers/thunderbolt/Kconfig
@@ -16,6 +16,16 @@ menuconfig USB4
To compile this driver a module, choose M here. The module will be
called thunderbolt.
+config USB4_DEBUGFS_WRITE
+ bool "Enable write by debugfs to configuration spaces (DANGEROUS)"
+ depends on USB4
+ help
+ Enables writing to device configuration registers through
+ debugfs interface.
+
+ Only enable this if you know what you are doing! Never enable
+ this for production systems or distro kernels.
+
config USB4_KUNIT_TEST
bool "KUnit tests"
depends on KUNIT=y