diff mbox series

thunderbolt: Use correct error code with ERROR_NOT_SUPPORTED

Message ID 20240415065528.576769-1-mika.westerberg@linux.intel.com (mailing list archive)
State New
Headers show
Series thunderbolt: Use correct error code with ERROR_NOT_SUPPORTED | expand

Commit Message

Mika Westerberg April 15, 2024, 6:55 a.m. UTC
We check for -EOPNOTSUPP but tb_xdp_handle_error() translated it to
-ENOTSUPP instead which is dealt as "transient" error and retried after
a while. Fix this so that we bail out early when the other side clearly
tells us it is does not support this.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 drivers/thunderbolt/xdomain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mika Westerberg April 19, 2024, 5:03 a.m. UTC | #1
On Mon, Apr 15, 2024 at 09:55:28AM +0300, Mika Westerberg wrote:
> We check for -EOPNOTSUPP but tb_xdp_handle_error() translated it to
> -ENOTSUPP instead which is dealt as "transient" error and retried after
> a while. Fix this so that we bail out early when the other side clearly
> tells us it is does not support this.
> 
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>

Applied to thunderbolt.git/next.
diff mbox series

Patch

diff --git a/drivers/thunderbolt/xdomain.c b/drivers/thunderbolt/xdomain.c
index 940ae97987ff..11a50c86a1e4 100644
--- a/drivers/thunderbolt/xdomain.c
+++ b/drivers/thunderbolt/xdomain.c
@@ -250,7 +250,7 @@  static int tb_xdp_handle_error(const struct tb_xdp_error_response *res)
 	case ERROR_UNKNOWN_DOMAIN:
 		return -EIO;
 	case ERROR_NOT_SUPPORTED:
-		return -ENOTSUPP;
+		return -EOPNOTSUPP;
 	case ERROR_NOT_READY:
 		return -EAGAIN;
 	default: