All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: linux-usb@vger.kernel.org
Cc: Yehezkel Bernat <YehezkelShB@gmail.com>,
	Michael Jamet <michael.jamet@intel.com>,
	Gil Fine <gil.fine@intel.com>, Lukas Wunner <lukas@wunner.de>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Andreas Noever <andreas.noever@gmail.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>
Subject: [PATCH 6/6] thunderbolt: Add debug logging of DisplayPort resource allocation
Date: Thu, 25 Nov 2021 10:37:33 +0300	[thread overview]
Message-ID: <20211125073733.74902-7-mika.westerberg@linux.intel.com> (raw)
In-Reply-To: <20211125073733.74902-1-mika.westerberg@linux.intel.com>

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

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 drivers/thunderbolt/switch.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index e00f4b878b56..13f9230104d7 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -3056,9 +3056,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;
 }
 
 /**
@@ -3081,6 +3092,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 {
-- 
2.33.0


  parent reply	other threads:[~2021-11-25  7:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-25  7:37 [PATCH 0/6] thunderbolt: Improvements for PM and USB4 compatibility Mika Westerberg
2021-11-25  7:37 ` [PATCH 1/6] thunderbolt: Runtime PM activate both ends of the device link Mika Westerberg
2021-11-26 18:03   ` Rafael J. Wysocki
2021-11-25  7:37 ` [PATCH 2/6] thunderbolt: Tear down existing tunnels when resuming from hibernate Mika Westerberg
2021-11-26 20:01   ` Lukas Wunner
2021-11-29  6:27     ` Mika Westerberg
2021-11-30 18:25       ` Yehezkel Bernat
2021-12-01  6:47         ` Mika Westerberg
2021-12-03 11:39           ` Yehezkel Bernat
2021-11-25  7:37 ` [PATCH 3/6] thunderbolt: Runtime resume USB4 port when retimers are scanned Mika Westerberg
2021-11-25  7:37 ` [PATCH 4/6] thunderbolt: Do not allow subtracting more NFC credits than configured Mika Westerberg
2021-11-25  7:37 ` [PATCH 5/6] thunderbolt: Do not program path HopIDs for USB4 routers Mika Westerberg
2021-11-25  7:37 ` Mika Westerberg [this message]
2021-12-07 12:22 ` [PATCH 0/6] thunderbolt: Improvements for PM and USB4 compatibility Mika Westerberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211125073733.74902-7-mika.westerberg@linux.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=YehezkelShB@gmail.com \
    --cc=andreas.noever@gmail.com \
    --cc=gil.fine@intel.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=michael.jamet@intel.com \
    --cc=rjw@rjwysocki.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.