]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-6.8/thunderbolt-calculate-displayport-tunnel-bandwidth-a.patch
09833471e83ecb667ce3e4daa2281a7aa7ba8738
[thirdparty/kernel/stable-queue.git] / queue-6.8 / thunderbolt-calculate-displayport-tunnel-bandwidth-a.patch
1 From 2c1fb148d887501f7ed62c55c164d571a44a33c6 Mon Sep 17 00:00:00 2001
2 From: Sasha Levin <sashal@kernel.org>
3 Date: Tue, 23 Jan 2024 15:56:42 +0200
4 Subject: thunderbolt: Calculate DisplayPort tunnel bandwidth after DPRX
5 capabilities read
6
7 From: Gil Fine <gil.fine@linux.intel.com>
8
9 [ Upstream commit ccd845021147dc8257a05ed8f5a7f9c61a9101e3 ]
10
11 According to USB4 Connection Manager guide, after DisplayPort tunnel was
12 setup, the DPRX capabilities read is performed by the DPTX. According to
13 VESA spec, this shall be completed within 5 seconds after the DisplayPort
14 tunnel was setup. Hence, if the bit: DPRX Capabilities Read Done, was
15 not set to '1' by this time, we timeout and fail calculating DisplayPort
16 tunnel consumed bandwidth.
17
18 Signed-off-by: Gil Fine <gil.fine@linux.intel.com>
19 Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
20 Signed-off-by: Sasha Levin <sashal@kernel.org>
21 ---
22 drivers/thunderbolt/tunnel.c | 16 ++++++----------
23 1 file changed, 6 insertions(+), 10 deletions(-)
24
25 diff --git a/drivers/thunderbolt/tunnel.c b/drivers/thunderbolt/tunnel.c
26 index 6fffb2c82d3d1..4f09216b70f90 100644
27 --- a/drivers/thunderbolt/tunnel.c
28 +++ b/drivers/thunderbolt/tunnel.c
29 @@ -1196,17 +1196,13 @@ static int tb_dp_consumed_bandwidth(struct tb_tunnel *tunnel, int *consumed_up,
30 /*
31 * Then see if the DPRX negotiation is ready and if yes
32 * return that bandwidth (it may be smaller than the
33 - * reduced one). Otherwise return the remote (possibly
34 - * reduced) caps.
35 + * reduced one). According to VESA spec, the DPRX
36 + * negotiation shall compete in 5 seconds after tunnel
37 + * established. We give it 100ms extra just in case.
38 */
39 - ret = tb_dp_wait_dprx(tunnel, 150);
40 - if (ret) {
41 - if (ret == -ETIMEDOUT)
42 - ret = tb_dp_read_cap(tunnel, DP_REMOTE_CAP,
43 - &rate, &lanes);
44 - if (ret)
45 - return ret;
46 - }
47 + ret = tb_dp_wait_dprx(tunnel, 5100);
48 + if (ret)
49 + return ret;
50 ret = tb_dp_read_cap(tunnel, DP_COMMON_CAP, &rate, &lanes);
51 if (ret)
52 return ret;
53 --
54 2.43.0
55