]> www.infradead.org Git - users/jedix/linux-maple.git/commit
thunderbolt: debugfs: Fix margin debugfs node creation condition
authorAapo Vienamo <aapo.vienamo@linux.intel.com>
Fri, 24 May 2024 15:53:17 +0000 (18:53 +0300)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Fri, 31 May 2024 10:13:39 +0000 (13:13 +0300)
commit985cfe501b74f214905ab4817acee0df24627268
treed2738433ed8f40b2567ee6d6c73a069192d98a5c
parent1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0
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 <aapo.vienamo@linux.intel.com>
Fixes: d0f1e0c2a699 ("thunderbolt: Add support for receiver lane margining")
Cc: stable@vger.kernel.org
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/thunderbolt/debugfs.c