public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3][RESUBMIT] scsi_dh_rdac: move the init code from rdac_activate to rdac_bus_attach
@ 2009-09-04  3:42 Moger, Babu
  2009-09-08 15:35 ` Chandra Seetharaman
  0 siblings, 1 reply; 2+ messages in thread
From: Moger, Babu @ 2009-09-04  3:42 UTC (permalink / raw)
  To: 'linux-scsi@vger.kernel.org'
  Cc: 'device mapper development',
	'sekharan@linux.vnet.ibm.com', Chauhan, Vijay,
	Stankey, Robert, Dachepalli, Sudhir

Moving the initialization code from rdac_activate to rdac_bus_attach which is more efficient.
We don't have to collect all the information during every activate. 

Signed-off-by: Babu Moger <babu.moger@lsi.com>
Reviewed-by: Vijay Chauhan <vijay.chauhan@lsi.com>
Reviewed-by: Bob Stankey <Robert.stankey@lsi.com>

---
--- linux-2.6.31-rc5/drivers/scsi/device_handler/scsi_dh_rdac.c.orig	2009-09-03 13:39:52.000000000 -0500
+++ linux-2.6.31-rc5/drivers/scsi/device_handler/scsi_dh_rdac.c	2009-09-03 14:10:40.000000000 -0500
@@ -525,17 +525,6 @@ static int rdac_activate(struct scsi_dev
 	if (err != SCSI_DH_OK)
 		goto done;
 
-	if (!h->ctlr) {
-		err = initialize_controller(sdev, h);
-		if (err != SCSI_DH_OK)
-			goto done;
-	}
-
-	if (h->ctlr->use_ms10 == -1) {
-		err = set_mode_select(sdev, h);
-		if (err != SCSI_DH_OK)
-			goto done;
-	}
 	if (h->lun_state == RDAC_LUN_UNOWNED)
 		err = send_mode_select(sdev, h);
 done:
@@ -674,12 +663,20 @@ static int rdac_bus_attach(struct scsi_d
 	if (err != SCSI_DH_OK)
 		goto failed;
 
-	err = check_ownership(sdev, h);
+	err = initialize_controller(sdev, h);
 	if (err != SCSI_DH_OK)
 		goto failed;
 
+	err = check_ownership(sdev, h);
+	if (err != SCSI_DH_OK)
+		goto clean_ctlr;
+
+	err = set_mode_select(sdev, h);
+	if (err != SCSI_DH_OK)
+		goto clean_ctlr;
+
 	if (!try_module_get(THIS_MODULE))
-		goto failed;
+		goto clean_ctlr;
 
 	spin_lock_irqsave(sdev->request_queue->queue_lock, flags);
 	sdev->scsi_dh_data = scsi_dh_data;
@@ -691,6 +688,9 @@ static int rdac_bus_attach(struct scsi_d
 
 	return 0;
 
+clean_ctlr:
+	kref_put(&h->ctlr->kref, release_controller);
+
 failed:
 	kfree(scsi_dh_data);
 	sdev_printk(KERN_ERR, sdev, "%s: not attached\n",



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/3][RESUBMIT] scsi_dh_rdac: move the init code from rdac_activate to rdac_bus_attach
  2009-09-04  3:42 [PATCH 1/3][RESUBMIT] scsi_dh_rdac: move the init code from rdac_activate to rdac_bus_attach Moger, Babu
@ 2009-09-08 15:35 ` Chandra Seetharaman
  0 siblings, 0 replies; 2+ messages in thread
From: Chandra Seetharaman @ 2009-09-08 15:35 UTC (permalink / raw)
  To: Moger, Babu
  Cc: 'linux-scsi@vger.kernel.org',
	'device mapper development', Chauhan, Vijay,
	Stankey, Robert, Dachepalli, Sudhir

Acked-by: Chandra Seetharaman <sekharan@us.ibm.com>
On Thu, 2009-09-03 at 21:42 -0600, Moger, Babu wrote:
> Moving the initialization code from rdac_activate to rdac_bus_attach which is more efficient.
> We don't have to collect all the information during every activate. 
> 
> Signed-off-by: Babu Moger <babu.moger@lsi.com>
> Reviewed-by: Vijay Chauhan <vijay.chauhan@lsi.com>
> Reviewed-by: Bob Stankey <Robert.stankey@lsi.com>
> 
> ---
> --- linux-2.6.31-rc5/drivers/scsi/device_handler/scsi_dh_rdac.c.orig	2009-09-03 13:39:52.000000000 -0500
> +++ linux-2.6.31-rc5/drivers/scsi/device_handler/scsi_dh_rdac.c	2009-09-03 14:10:40.000000000 -0500
> @@ -525,17 +525,6 @@ static int rdac_activate(struct scsi_dev
>  	if (err != SCSI_DH_OK)
>  		goto done;
>  
> -	if (!h->ctlr) {
> -		err = initialize_controller(sdev, h);
> -		if (err != SCSI_DH_OK)
> -			goto done;
> -	}
> -
> -	if (h->ctlr->use_ms10 == -1) {
> -		err = set_mode_select(sdev, h);
> -		if (err != SCSI_DH_OK)
> -			goto done;
> -	}
>  	if (h->lun_state == RDAC_LUN_UNOWNED)
>  		err = send_mode_select(sdev, h);
>  done:
> @@ -674,12 +663,20 @@ static int rdac_bus_attach(struct scsi_d
>  	if (err != SCSI_DH_OK)
>  		goto failed;
>  
> -	err = check_ownership(sdev, h);
> +	err = initialize_controller(sdev, h);
>  	if (err != SCSI_DH_OK)
>  		goto failed;
>  
> +	err = check_ownership(sdev, h);
> +	if (err != SCSI_DH_OK)
> +		goto clean_ctlr;
> +
> +	err = set_mode_select(sdev, h);
> +	if (err != SCSI_DH_OK)
> +		goto clean_ctlr;
> +
>  	if (!try_module_get(THIS_MODULE))
> -		goto failed;
> +		goto clean_ctlr;
>  
>  	spin_lock_irqsave(sdev->request_queue->queue_lock, flags);
>  	sdev->scsi_dh_data = scsi_dh_data;
> @@ -691,6 +688,9 @@ static int rdac_bus_attach(struct scsi_d
>  
>  	return 0;
>  
> +clean_ctlr:
> +	kref_put(&h->ctlr->kref, release_controller);
> +
>  failed:
>  	kfree(scsi_dh_data);
>  	sdev_printk(KERN_ERR, sdev, "%s: not attached\n",
> 
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-09-08 15:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-04  3:42 [PATCH 1/3][RESUBMIT] scsi_dh_rdac: move the init code from rdac_activate to rdac_bus_attach Moger, Babu
2009-09-08 15:35 ` Chandra Seetharaman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox