summaryrefslogtreecommitdiff
path: root/drivers/thunderbolt
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2020-02-14 20:25:34 +0300
committerMika Westerberg <mika.westerberg@linux.intel.com>2020-06-22 19:58:32 +0300
commit6bfe33473eaac9443dfce129b3107cc27abc1e47 (patch)
tree5024daf0cbbe0851addcb22568f2885afed5f392 /drivers/thunderbolt
parent7e72846bb97a86d19a249d230b12a6e33e947026 (diff)
downloadlinux-6bfe33473eaac9443dfce129b3107cc27abc1e47.tar.xz
thunderbolt: Retry USB4 block read operation
Especially when accessing retimers over USB4 sideband operations the possibility to get read errors seems to be higher so make the usb4_do_read_data() retry a couple of times if it sees any other error than -ENODEV (device is gone). We can only do this for read side because it carries the offset as part of metadata (as opposed to writes). Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt')
-rw-r--r--drivers/thunderbolt/usb4.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/thunderbolt/usb4.c b/drivers/thunderbolt/usb4.c
index 8a83857573df..142c7244bdb1 100644
--- a/drivers/thunderbolt/usb4.c
+++ b/drivers/thunderbolt/usb4.c
@@ -115,11 +115,8 @@ static int usb4_do_read_data(u16 address, void *buf, size_t size,
ret = read_block(read_block_data, dwaddress, data, dwords);
if (ret) {
- if (ret == -ETIMEDOUT) {
- if (retries--)
- continue;
- ret = -EIO;
- }
+ if (ret != -ENODEV && retries--)
+ continue;
return ret;
}