]> git.baikalelectronics.ru Git - kernel.git/commit
cxl: Fix lockdep warning while creating afu_err_buff attribute
authorVaibhav Jain <vaibhav@linux.vnet.ibm.com>
Wed, 23 Sep 2015 03:07:59 +0000 (08:37 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 23 Sep 2015 10:57:13 +0000 (20:57 +1000)
commitc54f9c873846ed42838b22cb4b52122c3ec70d23
treed62d1b7e66ee629b5ba8ec51cec3b17f68c37482
parent1b662551095573b27e200a0506a6ba6daa1c68f7
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: 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>
drivers/misc/cxl/sysfs.c