Skip to content

Commit

Permalink
UBUNTU: SAUCE: thunderbolt: Add debug logging of DisplayPort resource…
Browse files Browse the repository at this point in the history
… allocation

BugLink: https://bugs.launchpad.net/bugs/1955016

Add more debugging around DP resource allocation/de-allocation.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
(cherry picked from
https://patchwork.kernel.org/project/linux-usb/patch/20211125073733.74902-7-mika.westerberg@linux.intel.com/)
Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
  • Loading branch information
Mika Westerberg authored and Chia-Lin Kao (AceLan) committed Dec 21, 2021
1 parent 1f9ad70 commit b737f41
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions drivers/thunderbolt/switch.c
Original file line number Diff line number Diff line change
@@ -3049,9 +3049,20 @@ bool tb_switch_query_dp_resource(struct tb_switch *sw, struct tb_port *in)
*/
int tb_switch_alloc_dp_resource(struct tb_switch *sw, struct tb_port *in)
{
int ret;

if (tb_switch_is_usb4(sw))
return usb4_switch_alloc_dp_resource(sw, in);
return tb_lc_dp_sink_alloc(sw, in);
ret = usb4_switch_alloc_dp_resource(sw, in);
else
ret = tb_lc_dp_sink_alloc(sw, in);

if (ret)
tb_sw_warn(sw, "failed to allocate DP resource for port %d\n",
in->port);
else
tb_sw_dbg(sw, "allocated DP resource for port %d\n", in->port);

return ret;
}

/**
@@ -3074,6 +3085,8 @@ void tb_switch_dealloc_dp_resource(struct tb_switch *sw, struct tb_port *in)
if (ret)
tb_sw_warn(sw, "failed to de-allocate DP resource for port %d\n",
in->port);
else
tb_sw_dbg(sw, "released DP resource for port %d\n", in->port);
}

struct tb_sw_lookup {

0 comments on commit b737f41

Please sign in to comment.