Skip to content

Commit

Permalink
thunderbolt: Debug log an invalid config space reply just once
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mika Westerberg committed Jan 3, 2025
1 parent cfdfdb1 commit c55017a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/thunderbolt/ctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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:
/*
Expand Down

0 comments on commit c55017a

Please sign in to comment.