Skip to content

Commit

Permalink
cxl: Fix lockdep warning while creating afu_err_buff attribute
Browse files Browse the repository at this point in the history
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: Daniel Axtens <dja@axtens.net>
Signed-off-by: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
Acked-by: Ian Munsie <imunsie@au1.ibm.com>
Reviewed-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Vaibhav Jain authored and Michael Ellerman committed Sep 23, 2015
1 parent 793b8bf commit d6eb71a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/misc/cxl/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,8 @@ int cxl_sysfs_afu_add(struct cxl_afu *afu)

/* conditionally create the add the binary file for error info buffer */
if (afu->eb_len) {
sysfs_attr_init(&afu->attr_eb.attr);

afu->attr_eb.attr.name = "afu_err_buff";
afu->attr_eb.attr.mode = S_IRUGO;
afu->attr_eb.size = afu->eb_len;
Expand Down

0 comments on commit d6eb71a

Please sign in to comment.