linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Axtens <dja@axtens.net>
To: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org, Ian Munsie <imunsie@au1.ibm.com>,
	mikey@neuling.org
Subject: Re: [PATCH] cxl: Fix lockdep warning while creating afu_err_buff attribute
Date: Wed, 23 Sep 2015 13:21:06 +1000	[thread overview]
Message-ID: <1442978466.2081.1.camel@axtens.net> (raw)
In-Reply-To: <1442977679-4468-1-git-send-email-vaibhav@linux.vnet.ibm.com>

Reviewed-by: Daniel Axtens <dja@axtens.net>

Thanks Vaibhav!

On Wed, 2015-09-23 at 08:37 +0530, Vaibhav Jain wrote:
> 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>
> ---
>  drivers/misc/cxl/sysfs.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/misc/cxl/sysfs.c b/drivers/misc/cxl/sysfs.c
> index 25868c2..02006f7 100644
> --- a/drivers/misc/cxl/sysfs.c
> +++ b/drivers/misc/cxl/sysfs.c
> @@ -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;

-- 
Regards,
Daniel

  parent reply	other threads:[~2015-09-23  3:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-23  3:07 [PATCH] cxl: Fix lockdep warning while creating afu_err_buff attribute Vaibhav Jain
2015-09-23  3:20 ` Ian Munsie
2015-09-23  3:21 ` Daniel Axtens [this message]
2015-09-25  2:12 ` Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1442978466.2081.1.camel@axtens.net \
    --to=dja@axtens.net \
    --cc=imunsie@au1.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mikey@neuling.org \
    --cc=vaibhav@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).