From: Chandra Seetharaman <sekharan@us.ibm.com>
To: "Chauhan, Vijay" <Vijay.Chauhan@lsi.com>
Cc: Hannes Reinecke <hare@suse.de>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"dm-devel@redhat.com" <dm-devel@redhat.com>
Subject: Re: [PATCH][RESUBMIT] scsi_dh_rdac: Retry mode select for NO_SENSE, ABORTED_COMMAND, UNIT_ATTENTION, NOT_READY(02/04/01)
Date: Tue, 10 Mar 2009 11:48:44 -0700 [thread overview]
Message-ID: <1236710924.2178.4.camel@chandra-ubuntu> (raw)
In-Reply-To: <0D1E8821739E724A86F4D16902CE275C140E25C59C@inbmail01.lsi.com>
On Wed, 2009-03-04 at 12:17 +0530, Chauhan, Vijay wrote:
> ---
>
> This patch is to add retry for mode select if mode select command is returned with sense NO_SENSE,
> UNIT_ATTENTION, ABORTED_COMMAND, NOT_READY(02/04/01). This patch reorganise the sense keys from
> if-else to switch-case format for better maintainability.
>
> Signed-off-by: Vijay Chauhan <vijay.chauhan@lsi.com>
Acked-by: Chandra Seetharaman <sekharan@us.ibm.com>
> ---
>
> --- linux-2.6.29-rc5/drivers/scsi/device_handler/scsi_dh_rdac.c.orig 2009-02-14 05:01:30.000000000 +0530
> +++ linux-2.6.29-rc5/drivers/scsi/device_handler/scsi_dh_rdac.c 2009-03-04 11:25:19.000000000 +0530
> @@ -449,28 +449,40 @@ static int mode_select_handle_sense(stru
> unsigned char *sensebuf)
> {
> struct scsi_sense_hdr sense_hdr;
> - int sense, err = SCSI_DH_IO, ret;
> + int err = SCSI_DH_IO, ret;
>
> ret = scsi_normalize_sense(sensebuf, SCSI_SENSE_BUFFERSIZE, &sense_hdr);
> if (!ret)
> goto done;
>
> err = SCSI_DH_OK;
> - sense = (sense_hdr.sense_key << 16) | (sense_hdr.asc << 8) |
> - sense_hdr.ascq;
> - /* If it is retryable failure, submit the c9 inquiry again */
> - if (sense == 0x59136 || sense == 0x68b02 || sense == 0xb8b02 ||
> - sense == 0x62900) {
> - /* 0x59136 - Command lock contention
> - * 0x[6b]8b02 - Quiesense in progress or achieved
> - * 0x62900 - Power On, Reset, or Bus Device Reset
> - */
> - err = SCSI_DH_RETRY;
> - }
>
> - if (sense)
> + switch (sense_hdr.sense_key) {
> + case NO_SENSE:
> + case ABORTED_COMMAND:
> + case UNIT_ATTENTION:
> + err= SCSI_DH_RETRY;
> + break;
> + case NOT_READY:
> + if (sense_hdr.asc == 0x04 && sense_hdr.ascq == 0x01)
> + /* LUN Not Ready and is in the Process of Becoming
> + * Ready
> + */
> + err = SCSI_DH_RETRY;
> + break;
> + case ILLEGAL_REQUEST:
> + if (sense_hdr.asc == 0x91 && sense_hdr.ascq == 0x36)
> + /*
> + * Command Lock contention
> + */
> + err = SCSI_DH_RETRY;
> + break;
> + default:
> sdev_printk(KERN_INFO, sdev,
> - "MODE_SELECT failed with sense 0x%x.\n", sense);
> + "MODE_SELECT failed with sense %02x/%02x/%02x.\n",sense_hdr.sense_key,
> + sense_hdr.asc, sense_hdr.ascq );
> + }
> +
> done:
> return err;
> }--
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2009-03-10 18:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-02 5:56 [PATCH]scsi_dh_rdac: Retry mode select for NO_SENSE, ABORTED_COMMAND, UNIT_ATTENTION, NOT_READY(02/04/01) Chauhan, Vijay
2009-03-02 15:44 ` Hannes Reinecke
2009-03-04 6:47 ` [PATCH][RESUBMIT] scsi_dh_rdac: " Chauhan, Vijay
2009-03-10 18:48 ` Chandra Seetharaman [this message]
2009-03-11 20:48 ` James Bottomley
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=1236710924.2178.4.camel@chandra-ubuntu \
--to=sekharan@us.ibm.com \
--cc=Vijay.Chauhan@lsi.com \
--cc=dm-devel@redhat.com \
--cc=hare@suse.de \
--cc=linux-scsi@vger.kernel.org \
--cc=sekharan@linux.vnet.ibm.com \
/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.