diff mbox series

thunderbolt: Fix setting the CNS bit in ROUTER_CS_5

Message ID 20240127032628.29606-1-rahimi.mhmmd@gmail.com (mailing list archive)
State Accepted
Commit ec4d82f855ce332de26fe080892483de98cc1a19
Headers show
Series thunderbolt: Fix setting the CNS bit in ROUTER_CS_5 | expand

Commit Message

Mohammad Rahimi Jan. 27, 2024, 3:26 a.m. UTC
The bit 23, CM TBT3 Not Supported (CNS), in ROUTER_CS_5 indicates
whether a USB4 Connection Manager is TBT3-Compatible and should be:
    0b for TBT3-Compatible
    1b for Not TBT3-Compatible

Signed-off-by: Mohammad Rahimi <rahimi.mhmmd@gmail.com>
---
 drivers/thunderbolt/tb_regs.h | 2 +-
 drivers/thunderbolt/usb4.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Mika Westerberg Jan. 29, 2024, 7:51 a.m. UTC | #1
On Sat, Jan 27, 2024 at 11:26:28AM +0800, Mohammad Rahimi wrote:
> The bit 23, CM TBT3 Not Supported (CNS), in ROUTER_CS_5 indicates
> whether a USB4 Connection Manager is TBT3-Compatible and should be:
>     0b for TBT3-Compatible
>     1b for Not TBT3-Compatible

I'm sure at some point of the spec it was called C3S and the meaning was
opposite ;-) Nice catch though!

> Signed-off-by: Mohammad Rahimi <rahimi.mhmmd@gmail.com>

Tagged for stable and applied to thunderbolt.git/fixes, thanks!
diff mbox series

Patch

diff --git a/drivers/thunderbolt/tb_regs.h b/drivers/thunderbolt/tb_regs.h
index 87e4795275fe..6f798f6a2b84 100644
--- a/drivers/thunderbolt/tb_regs.h
+++ b/drivers/thunderbolt/tb_regs.h
@@ -203,7 +203,7 @@  struct tb_regs_switch_header {
 #define ROUTER_CS_5_WOP				BIT(1)
 #define ROUTER_CS_5_WOU				BIT(2)
 #define ROUTER_CS_5_WOD				BIT(3)
-#define ROUTER_CS_5_C3S				BIT(23)
+#define ROUTER_CS_5_CNS				BIT(23)
 #define ROUTER_CS_5_PTO				BIT(24)
 #define ROUTER_CS_5_UTO				BIT(25)
 #define ROUTER_CS_5_HCO				BIT(26)
diff --git a/drivers/thunderbolt/usb4.c b/drivers/thunderbolt/usb4.c
index f8f0d24ff6e4..1515eff8cc3e 100644
--- a/drivers/thunderbolt/usb4.c
+++ b/drivers/thunderbolt/usb4.c
@@ -290,7 +290,7 @@  int usb4_switch_setup(struct tb_switch *sw)
 	}
 
 	/* TBT3 supported by the CM */
-	val |= ROUTER_CS_5_C3S;
+	val &= ~ROUTER_CS_5_CNS;
 
 	return tb_sw_write(sw, &val, TB_CFG_SWITCH, ROUTER_CS_5, 1);
 }