From patchwork Tue Aug 25 00:12:21 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: babu moger X-Patchwork-Id: 43681 Received: from hormel.redhat.com (hormel1.redhat.com [209.132.177.33]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7P0CewU013547 for ; Tue, 25 Aug 2009 00:12:40 GMT Received: from listman.util.phx.redhat.com (listman.util.phx.redhat.com [10.8.4.110]) by hormel.redhat.com (Postfix) with ESMTP id 78B716199C2; Mon, 24 Aug 2009 20:12:39 -0400 (EDT) Received: from int-mx01.intmail.prod.int.phx2.redhat.com (nat-pool.util.phx.redhat.com [10.8.5.200]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id n7P0Ca6f026031 for ; Mon, 24 Aug 2009 20:12:36 -0400 Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.6]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7P0CaJl025517 for ; Mon, 24 Aug 2009 20:12:36 -0400 Received: from exprod7og109.obsmtp.com (exprod7og109.obsmtp.com [64.18.2.171]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n7P0CQWd021390 for ; Mon, 24 Aug 2009 20:12:26 -0400 Received: from source ([147.145.40.20]) by exprod7ob109.postini.com ([64.18.6.12]) with SMTP ID DSNKSpMsaFpog2OYsaYgFxBHEBuq2kdA7Om1@postini.com; Mon, 24 Aug 2009 17:12:26 PDT Received: from milmhbs0.lsil.com (mhbs.lsil.com [147.145.1.30]) by mail0.lsil.com (8.12.11/8.12.11) with ESMTP id n7P0CMsT027267; Mon, 24 Aug 2009 17:12:22 -0700 (PDT) Received: from coshub01.lsi.com (coshub01.co.lsil.com [172.21.36.64]) by milmhbs0.lsil.com (8.12.11/8.12.11) with ESMTP id n7P0CORL009746; Mon, 24 Aug 2009 17:12:24 -0700 Received: from cosmail01.lsi.com ([172.21.36.24]) by coshub01.lsi.com ([172.21.36.64]) with mapi; Mon, 24 Aug 2009 18:12:22 -0600 From: "Moger, Babu" To: Linux SCSI Mailing list Date: Mon, 24 Aug 2009 18:12:21 -0600 Thread-Topic: [PATCH 2/3] scsi_dh_rdac: Adding more debug options for scsi rdac handler Thread-Index: AcolGLcHuKBRjHKYSFmxRF/LQT2tEA== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-Scanned-By: MIMEDefang 2.67 on 10.5.110.6 X-Scanned-By: MIMEDefang 2.39 X-RedHat-Spam-Score: -4 (RCVD_IN_DNSWL_MED) X-MIME-Autoconverted: from base64 to 8bit by listman.util.phx.redhat.com id n7P0Ca6f026031 X-loop: dm-devel@redhat.com Cc: device-mapper development , "Chauhan, Vijay" , "Stankey, Robert" Subject: [dm-devel] [PATCH 2/3] scsi_dh_rdac: Adding more debug options for scsi rdac handler X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.5 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com Moving the initialization code from rdac_activate to rdac_bus_attach which is more efficient. We don’t have to collect these information during every activate. Signed-off-by: Babu Moger --- -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel --- linux-2.6.31-rc5/drivers/scsi/device_handler/scsi_dh_rdac.c.orig 2009-08-24 12:18:46.000000000 -0500 +++ linux-2.6.31-rc5/drivers/scsi/device_handler/scsi_dh_rdac.c 2009-08-24 12:26:43.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;