]> Gentwo Git Trees - linux/.git/commit
thunderbolt: Handle DisplayPort tunnel activation asynchronously
authorMika Westerberg <mika.westerberg@linux.intel.com>
Tue, 20 Aug 2024 05:56:02 +0000 (08:56 +0300)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Fri, 3 Jan 2025 09:50:09 +0000 (11:50 +0200)
commitd6d458d42e1e1544a18f37f1d5c840e00d5261b9
treed0c1a22c740a01084c94bd7cf0e46be80fb374fc
parenta70cd9cddeb2836377547efa9d76b391556ae687
thunderbolt: Handle DisplayPort tunnel activation asynchronously

Sometimes setting up a DisplayPort tunnel may take quite long time. The
reason is that the graphics driver (DPRX) is expected to issue read of
certain monitor capabilities over the AUX channel and the "suggested"
timeout from VESA is 5 seconds. If there is no graphics driver loaded
this does not happen and currently we timeout and tear the tunnel down.
The reason for this is that at least Intel discrete USB4 controllers do
not send plug/unplug events about whether the DisplayPort cable from the
GPU to the controller is connected or not, so in order to "release" the
DisplayPort OUT adapter (the one that has monitor connected) we must
tear the tunnel down after this timeout has been elapsed.

In typical cases there is always graphics driver loaded, and also all
the cables are connected but for instance in Intel graphics CI they only
load the graphics driver after the system is fully booted up. This
makes the driver to tear down the DisplayPort tunnel. To help this case
we allow passing bigger or indefinite timeout through a new module
parameter (dprx_timeout). To keep the driver bit more responsive during
that time we change the way DisplayPort tunnels get activated. We first
do the normal tunnel setup and then run the polling of DPRX capabilities
read completion in a separate worker. This also makes the driver to
accept bandwidth requests to already established DisplayPort tunnels
more responsive.

If the tunnel still fails to establish we will tear it down and remove
the DisplayPort IN adapter from the dp_resource list to avoid using it
again (unless we get hotplug to that adapter).

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/thunderbolt/tb.c
drivers/thunderbolt/test.c
drivers/thunderbolt/tunnel.c
drivers/thunderbolt/tunnel.h