diff mbox

[2/3,RESUBMIT] scsi_dh_rdac: move the init code from rdac_activate to rdac_bus_attach

Message ID E463DF2B2E584B4A82673F53D62C2EF474C65F3E@cosmail01.lsi.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

babu moger Aug. 28, 2009, 2:22 p.m. UTC
Moving the initialization code from rdac_activate to rdac_bus_attach which is more efficient. We don't have to collect all these 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>

---




--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
diff mbox

Patch

--- linux-2.6.31-rc5/drivers/scsi/device_handler/scsi_dh_rdac.c.orig	2009-08-27 18:30:24.000000000 -0500
+++ linux-2.6.31-rc5/drivers/scsi/device_handler/scsi_dh_rdac.c	2009-08-27 18:31:31.000000000 -0500
@@ -555,21 +555,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;
-
-		err = get_array_name(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:
@@ -712,6 +697,18 @@  static int rdac_bus_attach(struct scsi_d
 	if (err != SCSI_DH_OK)
 		goto failed;
 
+	err = initialize_controller(sdev, h);
+	if (err != SCSI_DH_OK)
+		goto failed;
+
+	err = get_array_name(sdev, h);
+	if (err != SCSI_DH_OK)
+		goto failed;
+		
+	err = set_mode_select(sdev, h);
+	if (err != SCSI_DH_OK)
+		goto failed;
+
 	if (!try_module_get(THIS_MODULE))
 		goto failed;