summaryrefslogtreecommitdiff
path: root/drivers/thunderbolt
diff options
context:
space:
mode:
authorGil Fine <gil.fine@intel.com>2021-03-09 11:23:30 +0200
committerMika Westerberg <mika.westerberg@linux.intel.com>2021-03-12 13:13:34 +0300
commit3382665a5c5de586cd6e93f9e892527d0775a1bb (patch)
tree120f43347c1416952b59c49ec6615370cda23e1d /drivers/thunderbolt
parentd59b8faa047ead7187e333ac967b8df40870ce2c (diff)
downloadlwn-3382665a5c5de586cd6e93f9e892527d0775a1bb.tar.gz
lwn-3382665a5c5de586cd6e93f9e892527d0775a1bb.zip
thunderbolt: debugfs: Show all accessible dwords
Currently, when first failure occurs while reading of the block, we stop reading the block and jump to the next capability. This doesn't cover the case of block with "holes" of inaccessible dwords, followed by accessible dwords. This patch address this problem. In case of failure while reading the complete block in one transaction, (because of one or more dwords is inaccessible), we read the remaining dwords of the block dword-by-dword, one dword per transaction, till the end of the block. By doing this, we handle the case of block with "holes" of inaccessible dwords, followed by accessible dwords. The accessible dwords are shown with the fields: <offset> <relative_offset> <cap_id> <vs_cap_id> <value> E.g.: 0x01eb 236 0x05 0x06 0x0000d166 While the inaccesible dwords are shown as: <offset> <not accessible> E.g.: 0x01ed <not accessible> Signed-off-by: Gil Fine <gil.fine@intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt')
-rw-r--r--drivers/thunderbolt/debugfs.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/thunderbolt/debugfs.c b/drivers/thunderbolt/debugfs.c
index 201036507cb8..c850b0ac098c 100644
--- a/drivers/thunderbolt/debugfs.c
+++ b/drivers/thunderbolt/debugfs.c
@@ -265,10 +265,8 @@ static void cap_show_by_dw(struct seq_file *s, struct tb_switch *sw,
else
ret = tb_sw_read(sw, &data, TB_CFG_SWITCH, cap + offset + i, 1);
if (ret) {
- seq_printf(s, "0x%04x <not accessible>\n", cap + offset);
- if (dwords - i > 1)
- seq_printf(s, "0x%04x ...\n", cap + offset + 1);
- return;
+ seq_printf(s, "0x%04x <not accessible>\n", cap + offset + i);
+ continue;
}
seq_printf(s, "0x%04x %4d 0x%02x 0x%02x 0x%08x\n", cap + offset + i,
@@ -292,7 +290,7 @@ static void cap_show(struct seq_file *s, struct tb_switch *sw,
else
ret = tb_sw_read(sw, data, TB_CFG_SWITCH, cap + offset, dwords);
if (ret) {
- cap_show_by_dw(s, sw, port, cap, offset, cap_id, vsec_id, dwords);
+ cap_show_by_dw(s, sw, port, cap, offset, cap_id, vsec_id, length);
return;
}