* [PATCH v2 1/1] EDAC: Fix lockdep splat caused by edac features code
@ 2025-06-26 10:13 shiju.jose
2025-06-26 12:51 ` Jonathan Cameron
2025-06-28 14:54 ` Borislav Petkov
0 siblings, 2 replies; 4+ messages in thread
From: shiju.jose @ 2025-06-26 10:13 UTC (permalink / raw)
To: linux-edac, bp, tony.luck, lenb, leo.duran, Yazen.Ghannam,
mchehab, dave.jiang, jonathan.cameron
Cc: linux-cxl, linuxarm, tanxiaofei, prime.zeng, shiju.jose
From: Shiju Jose <shiju.jose@huawei.com>
Fix the lockdep splat caused by missing sysfs_attr_init() calls
for the recently added EDAC feature's sysfs attributes.
In lockdep_init_map_type(), the check for the lock-class key
if (!static_obj(key) && !is_dynamic_key(key)) causes the splat.
Backtrace:
RIP: 0010:lockdep_init_map_type+0x131/0x270
Call Trace:
__kernfs_create_file+0x77/0xf0
sysfs_add_file_mode_ns+0x86/0x140
internal_create_group+0x1cc/0x4b0
internal_create_groups+0x42/0xa0
device_add+0x310/0x860
? __init_waitqueue_head+0x4a/0x60
edac_dev_register+0x3ff/0x480
devm_cxl_memdev_edac_register+0x509/0x640 [cxl_core]
? lock_acquire+0xc4/0x2d0
? find_held_lock+0x2b/0x80
? cxl_mem_probe+0x21e/0x360 [cxl_mem]
? cxl_mem_probe+0x21e/0x360 [cxl_mem]
? lockdep_hardirqs_on+0x78/0x100
? cxl_mem_probe+0x226/0x360 [cxl_mem]
cxl_mem_probe+0x226/0x360 [cxl_mem]
Fixes: f90b738166fe ("EDAC: Add scrub control feature")
Fixes: bcbd069b11b0 ("EDAC: Add a Error Check Scrub control feature")
Fixes: 699ea5219c4b ("EDAC: Add a memory repair control feature")
Reported-by: Dave Jiang <dave.jiang@intel.com>
Suggested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
---
Changes:
v1 -> v2
1. Changes for the feedback from Jonathan.
https://lore.kernel.org/linux-edac/aa142386d0944955b742340b2454e114@huawei.com/T/#md430a9f146794152ac45de57d0cda65caa7f765b
- Updated commit message.
- Called sysfs_attr_init() before put the pointer in the array
of attribute pointers.
---
drivers/edac/ecs.c | 4 +++-
drivers/edac/mem_repair.c | 1 +
drivers/edac/scrub.c | 1 +
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/edac/ecs.c b/drivers/edac/ecs.c
index 1d51838a60c1..51c451c7f0f0 100755
--- a/drivers/edac/ecs.c
+++ b/drivers/edac/ecs.c
@@ -170,8 +170,10 @@ static int ecs_create_desc(struct device *ecs_dev, const struct attribute_group
fru_ctx->dev_attr[ECS_RESET] = EDAC_ECS_ATTR_WO(reset, fru);
fru_ctx->dev_attr[ECS_THRESHOLD] = EDAC_ECS_ATTR_RW(threshold, fru);
- for (i = 0; i < ECS_MAX_ATTRS; i++)
+ for (i = 0; i < ECS_MAX_ATTRS; i++) {
+ sysfs_attr_init(&fru_ctx->dev_attr[i].dev_attr.attr);
fru_ctx->ecs_attrs[i] = &fru_ctx->dev_attr[i].dev_attr.attr;
+ }
sprintf(fru_ctx->name, "%s%d", EDAC_ECS_FRU_NAME, fru);
group->name = fru_ctx->name;
diff --git a/drivers/edac/mem_repair.c b/drivers/edac/mem_repair.c
index d1a8caa85369..70a033a76233 100755
--- a/drivers/edac/mem_repair.c
+++ b/drivers/edac/mem_repair.c
@@ -333,6 +333,7 @@ static int mem_repair_create_desc(struct device *dev,
for (i = 0; i < MR_MAX_ATTRS; i++) {
memcpy(&ctx->mem_repair_dev_attr[i],
&dev_attr[i], sizeof(dev_attr[i]));
+ sysfs_attr_init(&ctx->mem_repair_dev_attr[i].dev_attr.attr);
ctx->mem_repair_attrs[i] =
&ctx->mem_repair_dev_attr[i].dev_attr.attr;
}
diff --git a/drivers/edac/scrub.c b/drivers/edac/scrub.c
index e421d3ebd959..f9d02af2fc3a 100755
--- a/drivers/edac/scrub.c
+++ b/drivers/edac/scrub.c
@@ -176,6 +176,7 @@ static int scrub_create_desc(struct device *scrub_dev,
group = &scrub_ctx->group;
for (i = 0; i < SCRUB_MAX_ATTRS; i++) {
memcpy(&scrub_ctx->scrub_dev_attr[i], &dev_attr[i], sizeof(dev_attr[i]));
+ sysfs_attr_init(&scrub_ctx->scrub_dev_attr[i].dev_attr.attr);
scrub_ctx->scrub_attrs[i] = &scrub_ctx->scrub_dev_attr[i].dev_attr.attr;
}
sprintf(scrub_ctx->name, "%s%d", "scrub", instance);
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2 1/1] EDAC: Fix lockdep splat caused by edac features code
2025-06-26 10:13 [PATCH v2 1/1] EDAC: Fix lockdep splat caused by edac features code shiju.jose
@ 2025-06-26 12:51 ` Jonathan Cameron
2025-06-28 14:54 ` Borislav Petkov
1 sibling, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2025-06-26 12:51 UTC (permalink / raw)
To: shiju.jose
Cc: linux-edac, bp, tony.luck, lenb, leo.duran, Yazen.Ghannam,
mchehab, dave.jiang, linux-cxl, linuxarm, tanxiaofei, prime.zeng
On Thu, 26 Jun 2025 11:13:44 +0100
<shiju.jose@huawei.com> wrote:
> From: Shiju Jose <shiju.jose@huawei.com>
>
> Fix the lockdep splat caused by missing sysfs_attr_init() calls
> for the recently added EDAC feature's sysfs attributes.
>
> In lockdep_init_map_type(), the check for the lock-class key
> if (!static_obj(key) && !is_dynamic_key(key)) causes the splat.
>
> Backtrace:
> RIP: 0010:lockdep_init_map_type+0x131/0x270
> Call Trace:
> __kernfs_create_file+0x77/0xf0
> sysfs_add_file_mode_ns+0x86/0x140
> internal_create_group+0x1cc/0x4b0
> internal_create_groups+0x42/0xa0
> device_add+0x310/0x860
> ? __init_waitqueue_head+0x4a/0x60
> edac_dev_register+0x3ff/0x480
> devm_cxl_memdev_edac_register+0x509/0x640 [cxl_core]
> ? lock_acquire+0xc4/0x2d0
> ? find_held_lock+0x2b/0x80
> ? cxl_mem_probe+0x21e/0x360 [cxl_mem]
> ? cxl_mem_probe+0x21e/0x360 [cxl_mem]
> ? lockdep_hardirqs_on+0x78/0x100
> ? cxl_mem_probe+0x226/0x360 [cxl_mem]
> cxl_mem_probe+0x226/0x360 [cxl_mem]
>
> Fixes: f90b738166fe ("EDAC: Add scrub control feature")
> Fixes: bcbd069b11b0 ("EDAC: Add a Error Check Scrub control feature")
> Fixes: 699ea5219c4b ("EDAC: Add a memory repair control feature")
> Reported-by: Dave Jiang <dave.jiang@intel.com>
> Suggested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
> Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 1/1] EDAC: Fix lockdep splat caused by edac features code
2025-06-26 10:13 [PATCH v2 1/1] EDAC: Fix lockdep splat caused by edac features code shiju.jose
2025-06-26 12:51 ` Jonathan Cameron
@ 2025-06-28 14:54 ` Borislav Petkov
2025-06-30 8:36 ` Shiju Jose
1 sibling, 1 reply; 4+ messages in thread
From: Borislav Petkov @ 2025-06-28 14:54 UTC (permalink / raw)
To: shiju.jose
Cc: linux-edac, tony.luck, lenb, leo.duran, Yazen.Ghannam, mchehab,
dave.jiang, jonathan.cameron, linux-cxl, linuxarm, tanxiaofei,
prime.zeng
On Thu, Jun 26, 2025 at 11:13:44AM +0100, shiju.jose@huawei.com wrote:
> From: Shiju Jose <shiju.jose@huawei.com>
>
> Fix the lockdep splat caused by missing sysfs_attr_init() calls
> for the recently added EDAC feature's sysfs attributes.
>
> In lockdep_init_map_type(), the check for the lock-class key
> if (!static_obj(key) && !is_dynamic_key(key)) causes the splat.
>
> Backtrace:
> RIP: 0010:lockdep_init_map_type+0x131/0x270
> Call Trace:
> __kernfs_create_file+0x77/0xf0
> sysfs_add_file_mode_ns+0x86/0x140
> internal_create_group+0x1cc/0x4b0
> internal_create_groups+0x42/0xa0
> device_add+0x310/0x860
> ? __init_waitqueue_head+0x4a/0x60
> edac_dev_register+0x3ff/0x480
> devm_cxl_memdev_edac_register+0x509/0x640 [cxl_core]
> ? lock_acquire+0xc4/0x2d0
> ? find_held_lock+0x2b/0x80
> ? cxl_mem_probe+0x21e/0x360 [cxl_mem]
> ? cxl_mem_probe+0x21e/0x360 [cxl_mem]
> ? lockdep_hardirqs_on+0x78/0x100
> ? cxl_mem_probe+0x226/0x360 [cxl_mem]
> cxl_mem_probe+0x226/0x360 [cxl_mem]
>
> Fixes: f90b738166fe ("EDAC: Add scrub control feature")
> Fixes: bcbd069b11b0 ("EDAC: Add a Error Check Scrub control feature")
> Fixes: 699ea5219c4b ("EDAC: Add a memory repair control feature")
> Reported-by: Dave Jiang <dave.jiang@intel.com>
> Suggested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Applied, thanks.
While you're here: please make all those attributes static like in this patch:
https://lore.kernel.org/r/20250620114135.4017183-1-arnd@kernel.org
which I've already applied - you can base stuff ontop of edac-for-next.
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH v2 1/1] EDAC: Fix lockdep splat caused by edac features code
2025-06-28 14:54 ` Borislav Petkov
@ 2025-06-30 8:36 ` Shiju Jose
0 siblings, 0 replies; 4+ messages in thread
From: Shiju Jose @ 2025-06-30 8:36 UTC (permalink / raw)
To: Borislav Petkov
Cc: linux-edac@vger.kernel.org, tony.luck@intel.com, lenb@kernel.org,
leo.duran@amd.com, Yazen.Ghannam@amd.com, mchehab@kernel.org,
dave.jiang@intel.com, Jonathan Cameron, linux-cxl@vger.kernel.org,
Linuxarm, tanxiaofei, Zengtao (B)
>-----Original Message-----
>From: Borislav Petkov <bp@alien8.de>
>Sent: 28 June 2025 15:55
>To: Shiju Jose <shiju.jose@huawei.com>
>Cc: linux-edac@vger.kernel.org; tony.luck@intel.com; lenb@kernel.org;
>leo.duran@amd.com; Yazen.Ghannam@amd.com; mchehab@kernel.org;
>dave.jiang@intel.com; Jonathan Cameron <jonathan.cameron@huawei.com>;
>linux-cxl@vger.kernel.org; Linuxarm <linuxarm@huawei.com>; tanxiaofei
><tanxiaofei@huawei.com>; Zengtao (B) <prime.zeng@hisilicon.com>
>Subject: Re: [PATCH v2 1/1] EDAC: Fix lockdep splat caused by edac features
>code
>
>On Thu, Jun 26, 2025 at 11:13:44AM +0100, shiju.jose@huawei.com wrote:
>> From: Shiju Jose <shiju.jose@huawei.com>
>>
>> Fix the lockdep splat caused by missing sysfs_attr_init() calls for
>> the recently added EDAC feature's sysfs attributes.
>>
>> In lockdep_init_map_type(), the check for the lock-class key if
>> (!static_obj(key) && !is_dynamic_key(key)) causes the splat.
>>
>> Backtrace:
>> RIP: 0010:lockdep_init_map_type+0x131/0x270
>> Call Trace:
>> __kernfs_create_file+0x77/0xf0
>> sysfs_add_file_mode_ns+0x86/0x140
>> internal_create_group+0x1cc/0x4b0
>> internal_create_groups+0x42/0xa0
>> device_add+0x310/0x860
>> ? __init_waitqueue_head+0x4a/0x60
>> edac_dev_register+0x3ff/0x480
>> devm_cxl_memdev_edac_register+0x509/0x640 [cxl_core] ?
>> lock_acquire+0xc4/0x2d0 ? find_held_lock+0x2b/0x80 ?
>> cxl_mem_probe+0x21e/0x360 [cxl_mem] ? cxl_mem_probe+0x21e/0x360
>> [cxl_mem] ? lockdep_hardirqs_on+0x78/0x100 ?
>cxl_mem_probe+0x226/0x360
>> [cxl_mem]
>> cxl_mem_probe+0x226/0x360 [cxl_mem]
>>
>> Fixes: f90b738166fe ("EDAC: Add scrub control feature")
>> Fixes: bcbd069b11b0 ("EDAC: Add a Error Check Scrub control feature")
>> Fixes: 699ea5219c4b ("EDAC: Add a memory repair control feature")
>> Reported-by: Dave Jiang <dave.jiang@intel.com>
>> Suggested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>> Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
>
>Applied, thanks.
>
>While you're here: please make all those attributes static like in this patch:
>
>https://lore.kernel.org/r/20250620114135.4017183-1-arnd@kernel.org
>
>which I've already applied - you can base stuff ontop of edac-for-next.
Thanks Boris.
I will check and modify the attributes as static.
Thanks,
Shiju
>
>Thx.
>
>--
>Regards/Gruss,
> Boris.
>
>https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-06-30 8:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-26 10:13 [PATCH v2 1/1] EDAC: Fix lockdep splat caused by edac features code shiju.jose
2025-06-26 12:51 ` Jonathan Cameron
2025-06-28 14:54 ` Borislav Petkov
2025-06-30 8:36 ` Shiju Jose
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).