lkml.org 
[lkml]   [2022]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: Apple Thunderbolt Display chaining
Hi,

On Wed, Mar 30, 2022 at 10:24:35PM +0800, Brad Campbell wrote:
> Nope, that did the same thing. I wonder though. I'm testing it on the laptop and that reports :
> [ 0.442832] thunderbolt 0000:07:00.0: Thunderbolt 2 Switch: 8086:156d (Revision: 0, TB Version: 2)
>
> Changing "if (in->sw->generation == 1)" to "if (in->sw->generation == 2)" on the laptop solves that.

Heh, indeed I forgot that this is Falcon Ridge.

> I can't test hotplug properly on the iMac due to the radeon training issue.
>
> The laptop still has the issue of a cold boot working in one socket
> and not the other, but hot plug is working correctly.

Let's try this one next:

diff --git a/drivers/thunderbolt/tunnel.c b/drivers/thunderbolt/tunnel.c
index a473cc7d9a8d..7150b5bc5403 100644
--- a/drivers/thunderbolt/tunnel.c
+++ b/drivers/thunderbolt/tunnel.c
@@ -865,6 +865,8 @@ struct tb_tunnel *tb_tunnel_alloc_dp(struct tb *tb, struct tb_port *in,
struct tb_tunnel *tunnel;
struct tb_path **paths;
struct tb_path *path;
+ struct tb_port *port;
+ int link_nr;

if (WARN_ON(!in->cap_adap || !out->cap_adap))
return NULL;
@@ -883,22 +885,34 @@ struct tb_tunnel *tb_tunnel_alloc_dp(struct tb *tb, struct tb_port *in,

paths = tunnel->paths;

+ /*
+ * Hard code the lane for both DP IN adapters when first
+ * generation hardware is present in the topology.
+ */
+ link_nr = 1;
+ tb_for_each_port_on_path(in, out, port) {
+ if (tb_port_is_null(port) && port->sw->generation == 1) {
+ link_nr = in->port == 11 ? 1 : 0;
+ break;
+ }
+ }
+
path = tb_path_alloc(tb, in, TB_DP_VIDEO_HOPID, out, TB_DP_VIDEO_HOPID,
- 1, "Video");
+ link_nr, "Video");
if (!path)
goto err_free;
tb_dp_init_video_path(path);
paths[TB_DP_VIDEO_PATH_OUT] = path;

path = tb_path_alloc(tb, in, TB_DP_AUX_TX_HOPID, out,
- TB_DP_AUX_TX_HOPID, 1, "AUX TX");
+ TB_DP_AUX_TX_HOPID, link_nr, "AUX TX");
if (!path)
goto err_free;
tb_dp_init_aux_path(path);
paths[TB_DP_AUX_PATH_OUT] = path;

path = tb_path_alloc(tb, out, TB_DP_AUX_RX_HOPID, in,
- TB_DP_AUX_RX_HOPID, 1, "AUX RX");
+ TB_DP_AUX_RX_HOPID, link_nr, "AUX RX");
if (!path)
goto err_free;
tb_dp_init_aux_path(path);
\
 
 \ /
  Last update: 2022-03-30 16:48    [W:0.139 / U:0.636 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site