Skip to contentSkip to conversation

thunderbolt: debugfs: Use DEBUGFS_MODE with path config space access

PATCH Applied Mika Westerberg 2 participants 6 messages Nov 11 – Nov 16

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 thunderbolt: debugfs: Use DEBUGFS_MODE with path config space access

Commit 398da8e64321 ("thunderbolt: debugfs: Add write capability to path config space") added write support to path config spaces but forgot to update the mode accordingly. This fixes it to use correct mode via DEBUGFS_MODE.

Fixes 398da8e64321 ("thunderbolt: debugfs: Add write capability to path config space")
---
 drivers/thunderbolt/debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thunderbolt/debugfs.c +1 -1
index 6a6875eb07ba..0d9f41a0f2cd 100644
@@ -2519,7 +2519,7 @@ void tb_switch_debugfs_init(struct tb_switch *sw)
 		debugfs_dir = debugfs_create_dir(dir_name, sw->debugfs_dir);
 		debugfs_create_file("regs", DEBUGFS_MODE, debugfs_dir,
 				    port, &port_regs_fops);
-		debugfs_create_file("path", 0400, debugfs_dir, port,
+		debugfs_create_file("path", DEBUGFS_MODE, debugfs_dir, port,
 				    &path_fops);
 		if (port->config.counters_support)
 			debugfs_create_file("counters", 0600, debugfs_dir, port,
Signature · 1 line
2.50.1
#1 lore raw

PATCH 2/2 thunderbolt: Return -ETIMEDOUT if XDomain peer returns ERROR_NOT_READY

The XDomain protocol retries the message when it gets -EAGAIN from the handler. However, this also happens if the remote peer replies with ERROR_NOT_READY as tb_xdp_handle_error() also returns -EAGAIN. This can lead to infinite retry loop. Fix this by returning -ETIMEDOUT in that case.

Fixes 8e1de7042596 ("thunderbolt: Add support for XDomain lane bonding")
---
 drivers/thunderbolt/xdomain.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/thunderbolt/xdomain.c +4 -4
index 45e26833c953..e5a962537920 100644
@@ -1370,7 +1370,7 @@ static int tb_xdomain_get_uuid(struct tb_xdomain *xd)
 			return -EAGAIN;
 		}
 		dev_dbg(&xd->dev, "failed to read remote UUID\n");
-		return ret;
+		return ret != -EAGAIN ? ret : -ETIMEDOUT;
 	}
 
 	dev_dbg(&xd->dev, "got remote UUID %pUb\n", &uuid);
@@ -1425,7 +1425,7 @@ static int tb_xdomain_get_link_status(struct tb_xdomain *xd)
 			return -EAGAIN;
 		}
 		dev_dbg(&xd->dev, "failed to receive remote link status\n");
-		return ret;
+		return ret != -EAGAIN ? ret : -ETIMEDOUT;
 	}
 
 	dev_dbg(&xd->dev, "remote link supports width %#x speed %#x\n", slw, sls);
@@ -1472,7 +1472,7 @@ static int tb_xdomain_link_state_change(struct tb_xdomain *xd,
 			return -EAGAIN;
 		}
 		dev_err(&xd->dev, "failed request link state change, aborting\n");
-		return ret;
+		return ret != -EAGAIN ? ret : -ETIMEDOUT;
 	}
 
 	dev_dbg(&xd->dev, "received link state change response\n");
@@ -1564,7 +1564,7 @@ static int tb_xdomain_get_properties(struct tb_xdomain *xd)
 		dev_err(&xd->dev, "failed read XDomain properties from %pUb\n",
 			xd->remote_uuid);
 
-		return ret;
+		return ret != -EAGAIN ? ret : -ETIMEDOUT;
 	}
 
 	mutex_lock(&xd->lock);
Signature · 1 line
2.50.1
#2 lore raw

Re: [PATCH 2/2] thunderbolt: Return -ETIMEDOUT if XDomain peer returns ERROR_NOT_READY

Sashiko has reviewed this patch and found no issues.
Quoted 9 lines

The XDomain protocol retries the message when it gets -EAGAIN from the handler. However, this also happens if the remote peer replies with ERROR_NOT_READY as tb_xdp_handle_error() also returns -EAGAIN. This can lead to infinite retry loop. Fix this by returning -ETIMEDOUT in that case.

Fixes 8e1de7042596 ("thunderbolt: Add support for XDomain lane bonding")

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
author Applied
#3 lore raw

Re: [PATCH 2/2] thunderbolt: Return -ETIMEDOUT if XDomain peer returns ERROR_NOT_READY

In reply to Mika Westerberg
Quoted 9 lines · Mika Westerberg

The XDomain protocol retries the message when it gets -EAGAIN from the handler. However, this also happens if the remote peer replies with ERROR_NOT_READY as tb_xdp_handle_error() also returns -EAGAIN. This can lead to infinite retry loop. Fix this by returning -ETIMEDOUT in that case.

Fixes 8e1de7042596 ("thunderbolt: Add support for XDomain lane bonding")

Applied to thunderbolt.git/fixes.

#4 lore raw
In reply to Mika Westerberg
Sashiko has reviewed this patch and found no issues.
Quoted 7 lines

Commit 398da8e64321 ("thunderbolt: debugfs: Add write capability to path config space") added write support to path config spaces but forgot to update the mode accordingly. This fixes it to use correct mode via DEBUGFS_MODE.

Fixes 398da8e64321 ("thunderbolt: debugfs: Add write capability to path config space")

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
author Applied
#5 lore raw
In reply to Mika Westerberg
Quoted 7 lines · Mika Westerberg

Commit 398da8e64321 ("thunderbolt: debugfs: Add write capability to path config space") added write support to path config spaces but forgot to update the mode accordingly. This fixes it to use correct mode via DEBUGFS_MODE.

Fixes 398da8e64321 ("thunderbolt: debugfs: Add write capability to path config space")

Applied to thunderbolt.git/next.