Skip to content

Commit 0209c80

Browse files
Gil Finewesteri
authored andcommitted
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 <gil.fine@linux.intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
1 parent 75abb4f commit 0209c80

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

drivers/thunderbolt/debugfs.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
#include "tb.h"
1515
#include "sb_regs.h"
1616

17-
#define PORT_CAP_PCIE_LEN 1
17+
#define PORT_CAP_V1_PCIE_LEN 1
18+
#define PORT_CAP_V2_PCIE_LEN 2
1819
#define PORT_CAP_POWER_LEN 2
1920
#define PORT_CAP_LANE_LEN 3
2021
#define PORT_CAP_USB3_LEN 5
@@ -1175,7 +1176,10 @@ static void port_cap_show(struct tb_port *port, struct seq_file *s,
11751176

11761177
case TB_PORT_CAP_ADAP:
11771178
if (tb_port_is_pcie_down(port) || tb_port_is_pcie_up(port)) {
1178-
length = PORT_CAP_PCIE_LEN;
1179+
if (usb4_switch_version(port->sw) < 2)
1180+
length = PORT_CAP_V1_PCIE_LEN;
1181+
else
1182+
length = PORT_CAP_V2_PCIE_LEN;
11791183
} else if (tb_port_is_dpin(port)) {
11801184
if (usb4_switch_version(port->sw) < 2)
11811185
length = PORT_CAP_DP_V1_LEN;

0 commit comments

Comments
 (0)