diff options
author | Gil Fine <gil.fine@linux.intel.com> | 2024-01-23 15:56:42 +0200 |
---|---|---|
committer | Mika Westerberg <mika.westerberg@linux.intel.com> | 2024-02-16 12:29:23 +0200 |
commit | ccd845021147dc8257a05ed8f5a7f9c61a9101e3 (patch) | |
tree | 32ff86ae22e3de5dbf126735b377f10ab9be3a2b /drivers/thunderbolt | |
parent | 52a4490e89d7c4effe613d8dffd2ac0a2a786bd7 (diff) | |
download | linux-ccd845021147dc8257a05ed8f5a7f9c61a9101e3.tar.gz linux-ccd845021147dc8257a05ed8f5a7f9c61a9101e3.tar.bz2 linux-ccd845021147dc8257a05ed8f5a7f9c61a9101e3.zip |
thunderbolt: Calculate DisplayPort tunnel bandwidth after DPRX capabilities read
According to USB4 Connection Manager guide, after DisplayPort tunnel was
setup, the DPRX capabilities read is performed by the DPTX. According to
VESA spec, this shall be completed within 5 seconds after the DisplayPort
tunnel was setup. Hence, if the bit: DPRX Capabilities Read Done, was
not set to '1' by this time, we timeout and fail calculating DisplayPort
tunnel consumed bandwidth.
Signed-off-by: Gil Fine <gil.fine@linux.intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt')
-rw-r--r-- | drivers/thunderbolt/tunnel.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/thunderbolt/tunnel.c b/drivers/thunderbolt/tunnel.c index e02b34654d29..cb6609a56a03 100644 --- a/drivers/thunderbolt/tunnel.c +++ b/drivers/thunderbolt/tunnel.c @@ -1184,17 +1184,13 @@ static int tb_dp_consumed_bandwidth(struct tb_tunnel *tunnel, int *consumed_up, /* * Then see if the DPRX negotiation is ready and if yes * return that bandwidth (it may be smaller than the - * reduced one). Otherwise return the remote (possibly - * reduced) caps. + * reduced one). According to VESA spec, the DPRX + * negotiation shall compete in 5 seconds after tunnel + * established. We give it 100ms extra just in case. */ - ret = tb_dp_wait_dprx(tunnel, 150); - if (ret) { - if (ret == -ETIMEDOUT) - ret = tb_dp_read_cap(tunnel, DP_REMOTE_CAP, - &rate, &lanes); - if (ret) - return ret; - } + ret = tb_dp_wait_dprx(tunnel, 5100); + if (ret) + return ret; ret = tb_dp_read_cap(tunnel, DP_COMMON_CAP, &rate, &lanes); if (ret) return ret; |