summaryrefslogtreecommitdiff
path: root/drivers/thunderbolt
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2023-12-28 17:47:39 +0300
committerMika Westerberg <mika.westerberg@linux.intel.com>2024-02-16 13:29:22 +0300
commitc7857ee68e1b9b805430f365392b6d40f75a48fc (patch)
treef7417c2088d83979026a5eca827ade1cceb214a9 /drivers/thunderbolt
parentd44b9827e7f460c7555800065de81b75f4967145 (diff)
downloadlinux-c7857ee68e1b9b805430f365392b6d40f75a48fc.tar.xz
thunderbolt: Handle bandwidth allocation mode disable request
Graphics can disable DisplayPort bandwidth allocation mode as well so if this make sure to reset the tunnel state accordingly. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt')
-rw-r--r--drivers/thunderbolt/tb.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c
index 5b0434c140f9..abd86fd8d71f 100644
--- a/drivers/thunderbolt/tb.c
+++ b/drivers/thunderbolt/tb.c
@@ -2406,8 +2406,23 @@ static void tb_handle_dp_bandwidth_request(struct work_struct *work)
tb_port_dbg(in, "handling bandwidth allocation request\n");
+ tunnel = tb_find_tunnel(tb, TB_TUNNEL_DP, in, NULL);
+ if (!tunnel) {
+ tb_port_warn(in, "failed to find tunnel\n");
+ goto put_sw;
+ }
+
if (!usb4_dp_port_bandwidth_mode_enabled(in)) {
- tb_port_warn(in, "bandwidth allocation mode not enabled\n");
+ if (tunnel->bw_mode) {
+ /*
+ * Reset the tunnel back to use the legacy
+ * allocation.
+ */
+ tunnel->bw_mode = false;
+ tb_port_dbg(in, "DPTX disabled bandwidth allocation mode\n");
+ } else {
+ tb_port_warn(in, "bandwidth allocation mode not enabled\n");
+ }
goto put_sw;
}
@@ -2432,11 +2447,6 @@ static void tb_handle_dp_bandwidth_request(struct work_struct *work)
tb_port_dbg(in, "requested bandwidth %d Mb/s\n", requested_bw);
- tunnel = tb_find_tunnel(tb, TB_TUNNEL_DP, in, NULL);
- if (!tunnel) {
- tb_port_warn(in, "failed to find tunnel\n");
- goto put_sw;
- }
out = tunnel->dst_port;