thunderbolt: Only add device router DP IN to the head of the DP resource list
authorMika Westerberg <mika.westerberg@linux.intel.com>
Mon, 13 Nov 2023 10:49:13 +0000 (12:49 +0200)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Fri, 17 Nov 2023 11:05:57 +0000 (13:05 +0200)
commit480713b1ba8eac4617936f8404da34bda991c30e
tree2c25609f44b3eea9bd135d1d0aa54bd4e9c21640
parent5391bcfa56c79a891734e4d22aa0ca3217b86491
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: 274baf695b08 ("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>
drivers/thunderbolt/tb.c