[SRU][J/N:linux-bluefield][PATCH v1 1/1] UBUNTU: SAUCE: mlxbf_pmc: add sysfs_attr_init() during count_clock init

David Thompson davthompson at nvidia.com
Wed Oct 8 19:34:16 UTC 2025


BugLink: https://bugs.launchpad.net/bugs/2127119

The lock-related debug logic (CONFIG_LOCK_STAT) in the kernel
is noting the following error when BF3 is booted:

[   10.231318] BUG: key ffff00008a3402a8 has not been registered!
[   10.237249] ------------[ cut here ]------------
[   10.241914] DEBUG_LOCKS_WARN_ON(1)
[   10.241927] WARNING: CPU: 4 PID: 592 at kernel/locking/lockdep.c:4801 lockdep_init_map_type+0x1d4/0x2a0

The mlxbf_pmc driver must call sysfs_attr_init() during the
initialization of the "count_clock" data structure to avoid
this warning.

Signed-off-by: David Thompson <davthompson at nvidia.com>
---
 drivers/platform/mellanox/mlxbf-pmc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/platform/mellanox/mlxbf-pmc.c b/drivers/platform/mellanox/mlxbf-pmc.c
index 2e5f058a9ecd..178c468d0e9b 100644
--- a/drivers/platform/mellanox/mlxbf-pmc.c
+++ b/drivers/platform/mellanox/mlxbf-pmc.c
@@ -2036,6 +2036,7 @@ static int mlxbf_pmc_init_perftype_counter(struct device *dev, unsigned int blk_
 	if (pmc->block[blk_num].type == MLXBF_PMC_TYPE_CRSPACE) {
 		/* Program crspace counters to count clock cycles using "count_clock" sysfs */
 		attr = &pmc->block[blk_num].attr_count_clock;
+		sysfs_attr_init(&attr->dev_attr.attr);
 		attr->dev_attr.attr.mode = 0644;
 		attr->dev_attr.show = mlxbf_pmc_count_clock_show;
 		attr->dev_attr.store = mlxbf_pmc_count_clock_store;
-- 
2.43.2




More information about the kernel-team mailing list