]> www.infradead.org Git - users/dwmw2/linux.git/commit
interconnect: increase ICC_DYN_ID_START
authorGabor Juhos <j4g8y7@gmail.com>
Wed, 25 Jun 2025 13:34:23 +0000 (15:34 +0200)
committerGeorgi Djakov <djakov@kernel.org>
Thu, 26 Jun 2025 16:17:19 +0000 (19:17 +0300)
commit1809db75bd1fa71e27e199e4c5cc9072741f6052
tree72f6033f215bfcade73776bf869c5111c1902fa3
parentb44f12ae21f661e5d97fb4a8b234d6689f68f706
interconnect: increase ICC_DYN_ID_START

Since commit d30f83d278a9 ("interconnect: core: Add dynamic id allocation
support"), interconnect node ids greater than or equal to ICC_DYN_ID_START
are reserved for dynamic id allocation. Yet the icc_node_create_nolock()
function allows to directly use such ids for creating nodes. This can
cause problems by executing dynamic id related codepaths even for nodes
intended to use static ids.

For example, the 'nsscc-ipq9574' driver creates interconnect nodes with
static ids starting from 19148. Because these ids belongs to the dynamic
id range, the icc_node_add() function replaces the node names
unexpectedly.

The node names looked like this before the change:

  # grep nss_cc /sys/kernel/debug/interconnect/interconnect_summary
  nss_cc_nssnoc_ppe_clk_master                          0            0
  nss_cc_nssnoc_ppe_clk_slave                           0            0
  nss_cc_nssnoc_ppe_cfg_clk_master                      0            0
  ...

And those have an unexpected suffix now:

  # grep nss_cc /sys/kernel/debug/interconnect/interconnect_summary
  nss_cc_nssnoc_ppe_clk_master@39b00000.clock-controller            0            0
  nss_cc_nssnoc_ppe_clk_slave@39b00000.clock-controller            0            0
  nss_cc_nssnoc_ppe_cfg_clk_master@39b00000.clock-controller            0            0
  ...

Increase the value of ICC_DYN_ID_START to avoid this.

Also, add sanity check to the icc_node_create_nolock() function to prevent
directly creating nodes with ids reserved for dynamic allocation in order
to detect these kind of problems.

Fixes: d30f83d278a9 ("interconnect: core: Add dynamic id allocation support")
Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250625-icc-dyn-id-fix-v1-1-127cb5498449@gmail.com
Signed-off-by: Georgi Djakov <djakov@kernel.org>
drivers/interconnect/core.c