[PATCH v2 5/6][SRU][J][OEM-5.14] UBUNTU: SAUCE: thunderbolt: Do not program path HopIDs for USB4 routers
AceLan Kao
acelan.kao at canonical.com
Mon Dec 20 02:54:06 UTC 2021
From: Mika Westerberg <mika.westerberg at linux.intel.com>
BugLink: https://bugs.launchpad.net/bugs/1955016
These fields are marked read-only for USB4 routers so do not touch them
in that case. Update the kernel-doc of tb_dp_port_set_hops() to reflect
this too.
Signed-off-by: Mika Westerberg <mika.westerberg at linux.intel.com>
(cherry picked from
https://patchwork.kernel.org/project/linux-usb/patch/20211125073733.74902-6-mika.westerberg@linux.intel.com/)
Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao at canonical.com>
---
drivers/thunderbolt/switch.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index f384cda76e862..96828dc13bdee 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -1322,7 +1322,9 @@ int tb_dp_port_hpd_clear(struct tb_port *port)
* @aux_tx: AUX TX Hop ID
* @aux_rx: AUX RX Hop ID
*
- * Programs specified Hop IDs for DP IN/OUT port.
+ * Programs specified Hop IDs for DP IN/OUT port. Can be called for USB4
+ * router DP adapters too but does not program the values as the fields
+ * are read-only.
*/
int tb_dp_port_set_hops(struct tb_port *port, unsigned int video,
unsigned int aux_tx, unsigned int aux_rx)
@@ -1330,6 +1332,9 @@ int tb_dp_port_set_hops(struct tb_port *port, unsigned int video,
u32 data[2];
int ret;
+ if (tb_switch_is_usb4(port->sw))
+ return 0;
+
ret = tb_port_read(port, data, TB_CFG_PORT,
port->cap_adap + ADP_DP_CS_0, ARRAY_SIZE(data));
if (ret)
--
2.25.1
More information about the kernel-team
mailing list