Skip to content

Commit 1ab7750

Browse files
author
Desnes Nunes
committed
thunderbolt: Add DP OUT resource when DP tunnel is discovered
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2107603 Upstream Status: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b60e31bf18a7064032dbcb73dcb5b58f8a00a110 commit b60e31b Author: Sanjay R Mehta <sanju.mehta@amd.com> Date: Thu, 4 Aug 2022 05:48:38 -0500 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 <sanju.mehta@amd.com> Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Tested-by: Renjith Pananchikkal <Renjith.Pananchikkal@amd.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Desnes Nunes <desnesn@redhat.com>
1 parent 80d74a1 commit 1ab7750

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)