Skip to content

Commit c55017a

Browse files
committed
thunderbolt: Debug log an invalid config space reply just once
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 <[email protected]>
1 parent cfdfdb1 commit c55017a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/thunderbolt/ctl.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ struct tb_ctl {
7070
#define tb_ctl_dbg(ctl, format, arg...) \
7171
dev_dbg(&(ctl)->nhi->pdev->dev, format, ## arg)
7272

73+
#define tb_ctl_dbg_once(ctl, format, arg...) \
74+
dev_dbg_once(&(ctl)->nhi->pdev->dev, format, ## arg)
75+
7376
static DECLARE_WAIT_QUEUE_HEAD(tb_cfg_request_cancel_queue);
7477
/* Serializes access to request kref_get/put */
7578
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,
279282
* Invalid cfg_space/offset/length combination in
280283
* cfg_read/cfg_write.
281284
*/
282-
tb_ctl_dbg(ctl, "%llx:%x: invalid config space (%u) or offset\n",
283-
res->response_route, res->response_port, space);
285+
tb_ctl_dbg_once(ctl, "%llx:%x: invalid config space (%u) or offset\n",
286+
res->response_route, res->response_port, space);
284287
return;
285288
case TB_CFG_ERROR_NO_SUCH_PORT:
286289
/*

0 commit comments

Comments
 (0)