Skip to content

Commit 480713b

Browse files
committed
thunderbolt: Only add device router DP IN to the head of the DP resource list
When pairing DP IN and DP OUT adapters for DisplayPort tunneling, we should prioritize the possible external GPU DP IN adapters to take advantage of the its capabilities. However the commit in question did this for host router DP IN adapters too and that changes ordering of the initial DP IN resources in such way that resuming from suspend may end up using different resource and that may confuse the user. Fix this so that we only put DP IN adapters of device routers to the top of the resource list and leave host routers as is. Fixes: 274baf6 ("thunderbolt: Add DP IN added last in the head of the list of DP resources") Reported-by: Pengfei Xu <pengfei.xu@intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
1 parent 5391bcf commit 480713b

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

  • drivers/thunderbolt

drivers/thunderbolt/tb.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,17 @@ static void tb_add_dp_resources(struct tb_switch *sw)
213213
if (!tb_switch_query_dp_resource(sw, port))
214214
continue;
215215

216-
list_add(&port->list, &tcm->dp_resources);
216+
/*
217+
* If DP IN on device router exist, position it at the
218+
* beginning of the DP resources list, so that it is used
219+
* before DP IN of the host router. This way external GPU(s)
220+
* will be prioritized when pairing DP IN to a DP OUT.
221+
*/
222+
if (tb_route(sw))
223+
list_add(&port->list, &tcm->dp_resources);
224+
else
225+
list_add_tail(&port->list, &tcm->dp_resources);
226+
217227
tb_port_dbg(port, "DP IN resource available\n");
218228
}
219229
}

0 commit comments

Comments
 (0)