Commit d6eb71a6 authored by Vaibhav Jain's avatar Vaibhav Jain Committed by Michael Ellerman

cxl: Fix lockdep warning while creating afu_err_buff attribute

Presently a lockdep warning is reported during creation of afu_err_buff
bin_attribute for the afu. This is caused due to the variable attr.key
not pointing to a static class key, hence the function lockdep_init_map
reports this warning:

 BUG: key <some-address> not in .data!

The patch fixes this issue by calling sysfs_attr_init on the
attr_eb.attr structure before populating it with the afu_err_buff file
details. This will populate the attr.key variable with a static class
key so that lockdep_init_map stops complaining about the lockdep key not
being static.
Reported-by: default avatarDaniel Axtens <dja@axtens.net>
Signed-off-by: default avatarVaibhav Jain <vaibhav@linux.vnet.ibm.com>
Acked-by: default avatarIan Munsie <imunsie@au1.ibm.com>
Reviewed-by: default avatarDaniel Axtens <dja@axtens.net>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 793b8bf9
...@@ -592,6 +592,8 @@ int cxl_sysfs_afu_add(struct cxl_afu *afu) ...@@ -592,6 +592,8 @@ int cxl_sysfs_afu_add(struct cxl_afu *afu)
/* conditionally create the add the binary file for error info buffer */ /* conditionally create the add the binary file for error info buffer */
if (afu->eb_len) { if (afu->eb_len) {
sysfs_attr_init(&afu->attr_eb.attr);
afu->attr_eb.attr.name = "afu_err_buff"; afu->attr_eb.attr.name = "afu_err_buff";
afu->attr_eb.attr.mode = S_IRUGO; afu->attr_eb.attr.mode = S_IRUGO;
afu->attr_eb.size = afu->eb_len; afu->attr_eb.size = afu->eb_len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment