From patchwork Mon Apr 20 12:44:23 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Chauhan, Vijay" X-Patchwork-Id: 19009 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 n3KCixew019914 for ; Mon, 20 Apr 2009 12:44:59 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 7C8B3618E10; Mon, 20 Apr 2009 08:44:58 -0400 (EDT) Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id n3KCiuXC005451 for ; Mon, 20 Apr 2009 08:44:56 -0400 Received: from mx3.redhat.com (mx3.redhat.com [172.16.48.32]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n3KCitP3022926 for ; Mon, 20 Apr 2009 08:44:55 -0400 Received: from chip3og59.obsmtp.com (chip3og59.obsmtp.com [64.18.14.183]) by mx3.redhat.com (8.13.8/8.13.8) with ESMTP id n3KCidNs000670 for ; Mon, 20 Apr 2009 08:44:40 -0400 Received: from source ([147.145.40.20]) by chip3ob59.postini.com ([64.18.6.12]) with SMTP ID DSNKSexuLWk7l+yhvm29EHzkfGQnnj+SKIf/@postini.com; Mon, 20 Apr 2009 05:44:40 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 n3KCiS4V001025; Mon, 20 Apr 2009 05:44:28 -0700 (PDT) Received: from inbmail01.lsi.com (inbmail01.in.lsil.com [172.28.140.213]) by milmhbs0.lsil.com (8.12.11/8.12.11) with ESMTP id n3KCiQOj010693; Mon, 20 Apr 2009 05:44:27 -0700 Received: from inbmail01.lsi.com ([172.28.140.213]) by inbmail01.lsi.com ([172.28.140.213]) with mapi; Mon, 20 Apr 2009 18:14:24 +0530 From: "Chauhan, Vijay" To: "'sekharan@us.ibm.com'" , James Bottomley , Hannes Reinecke Date: Mon, 20 Apr 2009 18:14:23 +0530 Thread-Topic: [PATCH] scsi_dh_rdac: Retry for NOT_READY(02/04/01) in rdac device handler Thread-Index: AcnBtbtbZenpdulGRgCghLVjfzH/gg== Message-ID: <0D1E8821739E724A86F4D16902CE275C1410F4D4B1@inbmail01.lsi.com> 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.58 on 172.16.52.254 X-Scanned-By: MIMEDefang 2.63 on 172.16.48.32 X-Scanned-By: MIMEDefang 2.39 X-RedHat-Spam-Score: -4 X-MIME-Autoconverted: from quoted-printable to 8bit by listman.util.phx.redhat.com id n3KCiuXC005451 X-loop: dm-devel@redhat.com Cc: "'dm-devel@redhat.com'" , "linux-scsi@vger.kernel.org" Subject: [dm-devel] [PATCH] scsi_dh_rdac: Retry for NOT_READY(02/04/01) in rdac device 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 This patch resolves the following issue. Please give your comment. > I am having issue with scsi_io_completion routine. During > device discovery, READ CAPACITY is failing with 02/04/01. It > has been retried 5 times(with NEED_RETRY) but when retry gets > exhausted ,scsi_io_completion simply ends the request without > trying with delay retry. > > Here scsi_io_completion routine checks for deferred sense and if > not found, it sets error with -EIO, which eventually ends the > request and doesnot allow for any more retries. I am seeing > deffered error being checked only for REQ_TYPE_BLOCK_PC > command type. Does it meant that command with cmd_type > REQ_TYPE_BLOCK_PC having current error sense should not be > retried in scsi_io_completion? If yes, then would it be > better to retry in rdac device handler in that case. > > > On Tues, 2009-03-10 at 15:47, James Bottomley wrote: > > > + if (sense_hdr->asc == 0x04 && sense_hdr->ascq == 0x01) > > > + /* LUN Not Ready - Logical Unit Not > > Ready and is in > > > + * the process of becoming ready > > > + * Just retry. > > > + */ > > > + return ADD_TO_MLQUEUE; > > > + if (sense_hdr->asc == 0x04 && sense_hdr->ascq == 0x04) > > > + /* LUN Not Ready - Format In Progress > > > + * > > > + * Just retry. > > > + */ > > > + return ADD_TO_MLQUEUE; > > > + if (sense_hdr->asc == 0x04 && sense_hdr->ascq == 0x07) > > > + /* LUN Not Ready - Storage controller > > cannot respond > > > + * immediately to a PRIN or PROUT command. > > > + * Just retry. > > > + */ > > > + return ADD_TO_MLQUEUE; > > > > For all of these ... along with a few other not ready types, > > we already > > do a delayed retry at the mid-layer (in > scsi_io_completion). Is there > > some problem that causes this to need to be handled here as well? Thanks, Vijay Acked-by: Chandra Seetahraman --- During device discovery read capacity fails with 0x020401 and sets the device size to 0. As a reason any I/O submitted to this path gets killed at sd_prep_fn with BLKPREP_KILL. This patch is to retry for 0x020401. NEED_RETRY in scsi_decide_disposition does not give sufficient time for the device to become ready. Signed-off-by: Vijay Chauhan --- -- -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel --- linux-2.6.30-rc2/drivers/scsi/device_handler/scsi_dh_rdac.c.orig 2009-04-20 23:07:14.000000000 +0530 +++ linux-2.6.30-rc2/drivers/scsi/device_handler/scsi_dh_rdac.c 2009-04-20 23:11:27.000000000 +0530 @@ -561,6 +561,12 @@ static int rdac_check_sense(struct scsi_ struct rdac_dh_data *h = get_rdac_data(sdev); switch (sense_hdr->sense_key) { case NOT_READY: + if (sense_hdr->asc == 0x04 && sense_hdr->ascq == 0x01) + /* LUN Not Ready - Logical Unit Not Ready and is in + * the process of becoming ready + * Just retry. + */ + return ADD_TO_MLQUEUE; if (sense_hdr->asc == 0x04 && sense_hdr->ascq == 0x81) /* LUN Not Ready - Storage firmware incompatible * Manual code synchonisation required.