Commit 8648c646 authored by Gil Fine's avatar Gil Fine Committed by Mika Westerberg

thunderbolt: Create multiple DisplayPort tunnels if there are more DP IN/OUT pairs

Currently we only create one DisplayPort tunnel even if there would be
more DP IN/OUT pairs available. Specifically this happens when a router
is unplugged and we check if a new DisplayPort tunnel can be created. To
cover this create tunnels as long as we find suitable DP IN/OUT pairs.
Signed-off-by: default avatarGil Fine <gil.fine@linux.intel.com>
Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
parent d80d926c
...@@ -1284,18 +1284,13 @@ static struct tb_port *tb_find_dp_out(struct tb *tb, struct tb_port *in) ...@@ -1284,18 +1284,13 @@ static struct tb_port *tb_find_dp_out(struct tb *tb, struct tb_port *in)
return NULL; return NULL;
} }
static void tb_tunnel_dp(struct tb *tb) static bool tb_tunnel_one_dp(struct tb *tb)
{ {
int available_up, available_down, ret, link_nr; int available_up, available_down, ret, link_nr;
struct tb_cm *tcm = tb_priv(tb); struct tb_cm *tcm = tb_priv(tb);
struct tb_port *port, *in, *out; struct tb_port *port, *in, *out;
struct tb_tunnel *tunnel; struct tb_tunnel *tunnel;
if (!tb_acpi_may_tunnel_dp()) {
tb_dbg(tb, "DP tunneling disabled, not creating tunnel\n");
return;
}
/* /*
* Find pair of inactive DP IN and DP OUT adapters and then * Find pair of inactive DP IN and DP OUT adapters and then
* establish a DP tunnel between them. * establish a DP tunnel between them.
...@@ -1323,11 +1318,11 @@ static void tb_tunnel_dp(struct tb *tb) ...@@ -1323,11 +1318,11 @@ static void tb_tunnel_dp(struct tb *tb)
if (!in) { if (!in) {
tb_dbg(tb, "no suitable DP IN adapter available, not tunneling\n"); tb_dbg(tb, "no suitable DP IN adapter available, not tunneling\n");
return; return false;
} }
if (!out) { if (!out) {
tb_dbg(tb, "no suitable DP OUT adapter available, not tunneling\n"); tb_dbg(tb, "no suitable DP OUT adapter available, not tunneling\n");
return; return false;
} }
/* /*
...@@ -1400,7 +1395,7 @@ static void tb_tunnel_dp(struct tb *tb) ...@@ -1400,7 +1395,7 @@ static void tb_tunnel_dp(struct tb *tb)
* TMU mode to HiFi for CL0s to work. * TMU mode to HiFi for CL0s to work.
*/ */
tb_increase_tmu_accuracy(tunnel); tb_increase_tmu_accuracy(tunnel);
return; return true;
err_free: err_free:
tb_tunnel_free(tunnel); tb_tunnel_free(tunnel);
...@@ -1415,6 +1410,19 @@ static void tb_tunnel_dp(struct tb *tb) ...@@ -1415,6 +1410,19 @@ static void tb_tunnel_dp(struct tb *tb)
pm_runtime_put_autosuspend(&out->sw->dev); pm_runtime_put_autosuspend(&out->sw->dev);
pm_runtime_mark_last_busy(&in->sw->dev); pm_runtime_mark_last_busy(&in->sw->dev);
pm_runtime_put_autosuspend(&in->sw->dev); pm_runtime_put_autosuspend(&in->sw->dev);
return false;
}
static void tb_tunnel_dp(struct tb *tb)
{
if (!tb_acpi_may_tunnel_dp()) {
tb_dbg(tb, "DP tunneling disabled, not creating tunnel\n");
return;
}
while (tb_tunnel_one_dp(tb))
;
} }
static void tb_dp_resource_unavailable(struct tb *tb, struct tb_port *port) static void tb_dp_resource_unavailable(struct tb *tb, struct tb_port *port)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment