All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <w.sang@pengutronix.de>
To: Yinghai Lu <yinghai@kernel.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
	James Bottomley <James.Bottomley@HansenPartnership.com>,
	Greg KH <gregkh@suse.de>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux-Scsi <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] scsi: fix lockdep warning
Date: Sat, 20 Mar 2010 08:57:22 +0100	[thread overview]
Message-ID: <20100320075722.GE26934@pengutronix.de> (raw)
In-Reply-To: <4BA47692.7040401@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 4528 bytes --]

On Sat, Mar 20, 2010 at 12:17:38AM -0700, Yinghai Lu wrote:
> 
> with qlogic and emulex card etc.
> 
> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
> 
> ---
>  drivers/base/attribute_container.c |    1 +
>  drivers/scsi/lpfc/lpfc_attr.c      |    3 +++
>  drivers/scsi/scsi_sysfs.c          |   15 ++++++++++++---
>  3 files changed, 16 insertions(+), 3 deletions(-)
> 
> Index: linux-2.6/drivers/scsi/lpfc/lpfc_attr.c
> ===================================================================
> --- linux-2.6.orig/drivers/scsi/lpfc/lpfc_attr.c
> +++ linux-2.6/drivers/scsi/lpfc/lpfc_attr.c
> @@ -3780,6 +3780,7 @@ lpfc_alloc_sysfs_attr(struct lpfc_vport
>  	struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
>  	int error;
>  
> +	sysfs_bin_attr_init(&sysfs_drvr_stat_data_attr);
>  	error = sysfs_create_bin_file(&shost->shost_dev.kobj,
>  				      &sysfs_drvr_stat_data_attr);
>  
> @@ -3787,11 +3788,13 @@ lpfc_alloc_sysfs_attr(struct lpfc_vport
>  	if (error || vport->port_type == LPFC_NPIV_PORT)
>  		goto out;
>  
> +	sysfs_bin_attr_init(&sysfs_ctlreg_attr);
>  	error = sysfs_create_bin_file(&shost->shost_dev.kobj,
>  				      &sysfs_ctlreg_attr);
>  	if (error)
>  		goto out_remove_stat_attr;
>  
> +	sysfs_bin_attr_init(&sysfs_mbox_attr);
>  	error = sysfs_create_bin_file(&shost->shost_dev.kobj,
>  				      &sysfs_mbox_attr);

Huh, why is this? They are statically declared.


>  	if (error)
> Index: linux-2.6/drivers/scsi/scsi_sysfs.c
> ===================================================================
> --- linux-2.6.orig/drivers/scsi/scsi_sysfs.c
> +++ linux-2.6/drivers/scsi/scsi_sysfs.c
> @@ -907,20 +907,27 @@ int scsi_sysfs_add_sdev(struct scsi_devi
>  
>  	/* create queue files, which may be writable, depending on the host */
>  	if (sdev->host->hostt->change_queue_depth) {
> +		sysfs_bin_attr_init(&sdev_attr_queue_depth_rw);
>  		error = device_create_file(&sdev->sdev_gendev,
>  					   &sdev_attr_queue_depth_rw);
> +		sysfs_bin_attr_init(&sdev_attr_queue_ramp_up_period);
>  		error = device_create_file(&sdev->sdev_gendev,
>  					   &sdev_attr_queue_ramp_up_period);

ditto

>  	}
> -	else
> +	else {
> +		sysfs_bin_attr_init(&dev_attr_queue_depth);
>  		error = device_create_file(&sdev->sdev_gendev, &dev_attr_queue_depth);
> +	}
>  	if (error)
>  		return error;
>  
> -	if (sdev->host->hostt->change_queue_type)
> +	if (sdev->host->hostt->change_queue_type)  {
> +		sysfs_bin_attr_init(&sdev_attr_queue_type_rw);
>  		error = device_create_file(&sdev->sdev_gendev, &sdev_attr_queue_type_rw);

ditto

> -	else
> +	} else {
> +		sysfs_bin_attr_init(&dev_attr_queue_type);
>  		error = device_create_file(&sdev->sdev_gendev, &dev_attr_queue_type);
> +	}
>  	if (error)
>  		return error;
>  
> @@ -935,6 +942,7 @@ int scsi_sysfs_add_sdev(struct scsi_devi
>  	/* add additional host specific attributes */
>  	if (sdev->host->hostt->sdev_attrs) {
>  		for (i = 0; sdev->host->hostt->sdev_attrs[i]; i++) {
> +			sysfs_bin_attr_init(sdev->host->hostt->sdev_attrs[i]);
>  			error = device_create_file(&sdev->sdev_gendev,
>  					sdev->host->hostt->sdev_attrs[i]);
>  			if (error)
> @@ -1060,6 +1068,7 @@ int scsi_sysfs_add_host(struct Scsi_Host
>  	/* add host specific attributes */
>  	if (shost->hostt->shost_attrs) {
>  		for (i = 0; shost->hostt->shost_attrs[i]; i++) {
> +			sysfs_bin_attr_init(shost->hostt->shost_attrs[i]);
>  			error = device_create_file(&shost->shost_dev,
>  					shost->hostt->shost_attrs[i]);
>  			if (error)
> Index: linux-2.6/drivers/base/attribute_container.c
> ===================================================================
> --- linux-2.6.orig/drivers/base/attribute_container.c
> +++ linux-2.6/drivers/base/attribute_container.c
> @@ -328,6 +328,7 @@ attribute_container_add_attrs(struct dev
>  		return sysfs_create_group(&classdev->kobj, cont->grp);
>  
>  	for (i = 0; attrs[i]; i++) {
> +		sysfs_bin_attr_init(attrs[i]);
>  		error = device_create_file(classdev, attrs[i]);
>  		if (error)
>  			return error;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2010-03-20  7:57 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-08 23:47 2.6.34-rc1: ACPI: BUG: key f71f0168 not in .data! Alexander Beregalov
2010-03-09  0:12 ` Yinghai Lu
2010-03-09  0:32   ` Yinghai Lu
2010-03-09  0:40     ` Américo Wang
2010-03-09  0:35   ` Eric W. Biederman
2010-03-09  7:06     ` Yinghai Lu
2010-03-09  7:57       ` Eric W. Biederman
2010-03-09  7:57       ` Eric W. Biederman
2010-03-12  2:29         ` Yinghai Lu
2010-03-12  2:32           ` Yinghai Lu
2010-03-13  3:36             ` Yinghai Lu
2010-03-13  3:54               ` Greg KH
2010-03-13  3:37           ` Yinghai Lu
2010-03-13  4:46             ` James Bottomley
2010-03-13  4:58               ` Eric W. Biederman
2010-03-13  5:13                 ` Matthew Wilcox
2010-03-20  7:17           ` [PATCH] scsi: fix lockdep warning Yinghai Lu
2010-03-20  7:57             ` Wolfram Sang [this message]
2010-03-20 12:58             ` Greg KH
2010-03-20 15:41             ` James Bottomley
2010-03-20 19:07               ` [PATCH] driver: fix lockdep with sysfs Yinghai Lu
2010-03-30 15:05             ` [PATCH] scsi: fix lockdep warning Ben Gamari
2010-03-30 17:08               ` Yinghai Lu
2010-03-30 20:33                 ` Ben Gamari
2010-03-31  1:55               ` Wolfram Sang

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=20100320075722.GE26934@pengutronix.de \
    --to=w.sang@pengutronix.de \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=ebiederm@xmission.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=yinghai@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.