Linux USB
 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>,
	Lukas Wunner <lukas@wunner.de>,
	Andreas Noever <andreas.noever@gmail.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>
Subject: [PATCH 03/12] thunderbolt: Debug log an invalid config space reply just once
Date: Tue, 17 Dec 2024 10:22:13 +0200	[thread overview]
Message-ID: <20241217082222.528602-4-mika.westerberg@linux.intel.com> (raw)
In-Reply-To: <20241217082222.528602-1-mika.westerberg@linux.intel.com>

These can mess up the debug log if a router does not implement the
config space register blocks fully and we are reading registers through
debugfs. To avoid this, just log it once.

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

diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c
index fd40cda1e53f..dc1f456736dc 100644
--- a/drivers/thunderbolt/ctl.c
+++ b/drivers/thunderbolt/ctl.c
@@ -70,6 +70,9 @@ struct tb_ctl {
 #define tb_ctl_dbg(ctl, format, arg...) \
 	dev_dbg(&(ctl)->nhi->pdev->dev, format, ## arg)
 
+#define tb_ctl_dbg_once(ctl, format, arg...) \
+	dev_dbg_once(&(ctl)->nhi->pdev->dev, format, ## arg)
+
 static DECLARE_WAIT_QUEUE_HEAD(tb_cfg_request_cancel_queue);
 /* Serializes access to request kref_get/put */
 static DEFINE_MUTEX(tb_cfg_request_lock);
@@ -279,8 +282,8 @@ static void tb_cfg_print_error(struct tb_ctl *ctl, enum tb_cfg_space space,
 		 * Invalid cfg_space/offset/length combination in
 		 * cfg_read/cfg_write.
 		 */
-		tb_ctl_dbg(ctl, "%llx:%x: invalid config space (%u) or offset\n",
-			   res->response_route, res->response_port, space);
+		tb_ctl_dbg_once(ctl, "%llx:%x: invalid config space (%u) or offset\n",
+				res->response_route, res->response_port, space);
 		return;
 	case TB_CFG_ERROR_NO_SUCH_PORT:
 		/*
-- 
2.45.2


  parent reply	other threads:[~2024-12-17  8:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-17  8:22 [PATCH 00/12] thunderbolt: Improve DisplayPort tunneling Mika Westerberg
2024-12-17  8:22 ` [PATCH 01/12] thunderbolt: Drop doubled empty line from ctl.h Mika Westerberg
2024-12-17  8:22 ` [PATCH 02/12] thunderbolt: Log config space when invalid config space reply is received Mika Westerberg
2024-12-17  8:22 ` Mika Westerberg [this message]
2024-12-17  8:22 ` [PATCH 04/12] thunderbolt: Increase DPRX capabilities read timeout Mika Westerberg
2024-12-17  8:22 ` [PATCH 05/12] thunderbolt: Make tb_tunnel_one_dp() return void Mika Westerberg
2024-12-17  8:22 ` [PATCH 06/12] thunderbolt: Show path name in debug log when path is deactivated Mika Westerberg
2024-12-17  8:22 ` [PATCH 07/12] thunderbolt: Rework how tunnel->[init|deinit] hooks are called Mika Westerberg
2024-12-17  8:22 ` [PATCH 08/12] thunderbolt: Drop tb_tunnel_restart() Mika Westerberg
2024-12-17  8:22 ` [PATCH 09/12] thunderbolt: Pass reason to tb_dp_resource_unavailable() Mika Westerberg
2024-12-17  8:22 ` [PATCH 10/12] thunderbolt: Move forward declarations in one place Mika Westerberg
2024-12-17  8:22 ` [PATCH 11/12] thunderbolt: Rework tb_tunnel_consumed_bandwidth() Mika Westerberg
2024-12-17  8:22 ` [PATCH 12/12] thunderbolt: Handle DisplayPort tunnel activation asynchronously Mika Westerberg
2024-12-19 17:03   ` Lukas Wunner
2024-12-19 17:29     ` Mika Westerberg
2025-01-03  9:56 ` [PATCH 00/12] thunderbolt: Improve DisplayPort tunneling 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=20241217082222.528602-4-mika.westerberg@linux.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=YehezkelShB@gmail.com \
    --cc=andreas.noever@gmail.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=michael.jamet@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox