Skip to content

Commit b60e31b

Browse files
Sanjay R Mehtawesteri
authored andcommitted
thunderbolt: Add DP OUT resource when DP tunnel is discovered
If the boot firmware implements a connection manager of its own it may create a DisplayPort tunnel and will be handed off to Linux connection manager, but the DP OUT resource is not saved in the dp_resource list. This patch adds tunnelled DP OUT port to the dp_resource list once the DP tunnel is discovered. Signed-off-by: Sanjay R Mehta <[email protected]> Signed-off-by: Basavaraj Natikar <[email protected]> Tested-by: Renjith Pananchikkal <[email protected]> Signed-off-by: Mika Westerberg <[email protected]>
1 parent 568035b commit b60e31b

File tree

1 file changed

+28
-0
lines changed
  • drivers/thunderbolt

1 file changed

+28
-0
lines changed

drivers/thunderbolt/tb.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,32 @@ static void tb_remove_dp_resources(struct tb_switch *sw)
105105
}
106106
}
107107

108+
static void tb_discover_dp_resource(struct tb *tb, struct tb_port *port)
109+
{
110+
struct tb_cm *tcm = tb_priv(tb);
111+
struct tb_port *p;
112+
113+
list_for_each_entry(p, &tcm->dp_resources, list) {
114+
if (p == port)
115+
return;
116+
}
117+
118+
tb_port_dbg(port, "DP %s resource available discovered\n",
119+
tb_port_is_dpin(port) ? "IN" : "OUT");
120+
list_add_tail(&port->list, &tcm->dp_resources);
121+
}
122+
123+
static void tb_discover_dp_resources(struct tb *tb)
124+
{
125+
struct tb_cm *tcm = tb_priv(tb);
126+
struct tb_tunnel *tunnel;
127+
128+
list_for_each_entry(tunnel, &tcm->tunnel_list, list) {
129+
if (tb_tunnel_is_dp(tunnel))
130+
tb_discover_dp_resource(tb, tunnel->dst_port);
131+
}
132+
}
133+
108134
static void tb_switch_discover_tunnels(struct tb_switch *sw,
109135
struct list_head *list,
110136
bool alloc_hopids)
@@ -1446,6 +1472,8 @@ static int tb_start(struct tb *tb)
14461472
tb_scan_switch(tb->root_switch);
14471473
/* Find out tunnels created by the boot firmware */
14481474
tb_discover_tunnels(tb);
1475+
/* Add DP resources from the DP tunnels created by the boot firmware */
1476+
tb_discover_dp_resources(tb);
14491477
/*
14501478
* If the boot firmware did not create USB 3.x tunnels create them
14511479
* now for the whole topology.

0 commit comments

Comments
 (0)