* [PATCH]scsi_dh_rdac: Retry mode select for NO_SENSE, ABORTED_COMMAND, UNIT_ATTENTION, NOT_READY(02/04/01)
@ 2009-03-02 5:56 Chauhan, Vijay
2009-03-02 15:44 ` Hannes Reinecke
0 siblings, 1 reply; 5+ messages in thread
From: Chauhan, Vijay @ 2009-03-02 5:56 UTC (permalink / raw)
To: linux-scsi@vger.kernel.org, sekharan@us.ibm.com; +Cc: dm-devel@redhat.com
This patch is to add retry for mode select if mode select command is returned with sense key NO_SENSE,
ABORTED_COMMAND, UNIT_ATTENTION or NOT_READY(02/04/01). This patch reorganise the sense from
if-else to switch-case format in scsi_dh_rdac.c for better maintainability.
Signed-off-by: Vijay Chauhan <vijay.chauhan@lsi.com>
---
--- linux-2.6.29-rc5/drivers/scsi/device_handler/scsi_dh_rdac.c.orig 2009-02-24 12:08:43.000000000 +0530
+++ linux-2.6.29-rc5/drivers/scsi/device_handler/scsi_dh_rdac.c 2009-02-28 18:18:41.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
- */
+
+ 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 %02x/%02x/%02x.\n",
+ sense_hdr.sense_key, sense_hdr.asc, sense_hdr.ascq);
}
- if (sense)
- sdev_printk(KERN_INFO, sdev,
- "MODE_SELECT failed with sense 0x%x.\n", sense);
done:
return err;
}
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH]scsi_dh_rdac: Retry mode select for NO_SENSE, ABORTED_COMMAND, UNIT_ATTENTION, NOT_READY(02/04/01)
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
0 siblings, 1 reply; 5+ messages in thread
From: Hannes Reinecke @ 2009-03-02 15:44 UTC (permalink / raw)
To: Chauhan, Vijay
Cc: linux-scsi@vger.kernel.org, sekharan@us.ibm.com,
dm-devel@redhat.com
Hi Vijay,
Chauhan, Vijay wrote:
> This patch is to add retry for mode select if mode select command is returned with sense key NO_SENSE,
> ABORTED_COMMAND, UNIT_ATTENTION or NOT_READY(02/04/01). This patch reorganise the sense from
> if-else to switch-case format in scsi_dh_rdac.c for better maintainability.
>
> Signed-off-by: Vijay Chauhan <vijay.chauhan@lsi.com>
> ---
>
> --- linux-2.6.29-rc5/drivers/scsi/device_handler/scsi_dh_rdac.c.orig 2009-02-24 12:08:43.000000000 +0530
> +++ linux-2.6.29-rc5/drivers/scsi/device_handler/scsi_dh_rdac.c 2009-02-28 18:18:41.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
> - */
> +
> + 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;
Missing indentation.
What about the other 'in progress' ASC/ASQ codes (ie 04/04 - 04/09) ?
Can they safely be ignored as the array will not issue them?
> + break;
> + case ILLEGAL_REQUEST:
> + if (sense_hdr.asc == 0x91 && sense_hdr.ascq == 0x36)
> + /*
> + * Command Lock contention
> + */
> err = SCSI_DH_RETRY;
Again, missing indentation.
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.de +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)
--
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH][RESUBMIT] scsi_dh_rdac: Retry mode select for NO_SENSE, ABORTED_COMMAND, UNIT_ATTENTION, NOT_READY(02/04/01)
2009-03-02 15:44 ` Hannes Reinecke
@ 2009-03-04 6:47 ` Chauhan, Vijay
2009-03-10 18:48 ` Chandra Seetharaman
2009-03-11 20:48 ` James Bottomley
0 siblings, 2 replies; 5+ messages in thread
From: Chauhan, Vijay @ 2009-03-04 6:47 UTC (permalink / raw)
To: Hannes Reinecke, sekharan@us.ibm.com
Cc: linux-scsi@vger.kernel.org, dm-devel@redhat.com
Hi Hannes,
Thanks for your comment. I have modified the patch with correct indentation. Resubmitting this patch.
For other ASC/ASQ codes (ie 04/04 - 04/09), I am currently working on it and will be adding it
in future if needed.
On Mon, March 02, 2009 9:14 PM Hannes Reinecke wrote:
> > + err = SCSI_DH_RETRY;
> Missing indentation.
>
> What about the other 'in progress' ASC/ASQ codes (ie 04/04 - 04/09) ?
> Can they safely be ignored as the array will not issue them?
>
> > + break;
> > + case ILLEGAL_REQUEST:
> > + if (sense_hdr.asc == 0x91 && sense_hdr.ascq == 0x36)
> > + /*
> > + * Command Lock contention
> > + */
> > err = SCSI_DH_RETRY;
> Again, missing indentation.
Thanks,
Vijay
---
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>
---
--- 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;
}
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH][RESUBMIT] scsi_dh_rdac: Retry mode select for NO_SENSE, ABORTED_COMMAND, UNIT_ATTENTION, NOT_READY(02/04/01)
2009-03-04 6:47 ` [PATCH][RESUBMIT] scsi_dh_rdac: " Chauhan, Vijay
@ 2009-03-10 18:48 ` Chandra Seetharaman
2009-03-11 20:48 ` James Bottomley
1 sibling, 0 replies; 5+ messages in thread
From: Chandra Seetharaman @ 2009-03-10 18:48 UTC (permalink / raw)
To: Chauhan, Vijay
Cc: Hannes Reinecke, linux-scsi@vger.kernel.org, dm-devel@redhat.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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH][RESUBMIT] scsi_dh_rdac: Retry mode select for NO_SENSE, ABORTED_COMMAND, UNIT_ATTENTION, NOT_READY(02/04/01)
2009-03-04 6:47 ` [PATCH][RESUBMIT] scsi_dh_rdac: " Chauhan, Vijay
2009-03-10 18:48 ` Chandra Seetharaman
@ 2009-03-11 20:48 ` James Bottomley
1 sibling, 0 replies; 5+ messages in thread
From: James Bottomley @ 2009-03-11 20:48 UTC (permalink / raw)
To: Chauhan, Vijay; +Cc: dm-devel@redhat.com, linux-scsi@vger.kernel.org
On Wed, 2009-03-04 at 12:17 +0530, Chauhan, Vijay wrote:
> Hi Hannes,
>
> Thanks for your comment. I have modified the patch with correct indentation. Resubmitting this patch.
> For other ASC/ASQ codes (ie 04/04 - 04/09), I am currently working on it and will be adding it
> in future if needed.
checkpatch.pl doesn't like you very much:
jejb@mulgrave> ./scripts/checkpatch.pl ~/tmp.mail
ERROR: spaces required around that '=' (ctx:VxW)
#135: FILE: drivers/scsi/device_handler/scsi_dh_rdac.c:464:
+ err= SCSI_DH_RETRY;
^
WARNING: line over 80 characters
#154: FILE: drivers/scsi/device_handler/scsi_dh_rdac.c:482:
+ "MODE_SELECT failed with sense %02x/%02x/%02x.\n",sense_hdr.sense_key,
ERROR: space required after that ',' (ctx:VxV)
#154: FILE: drivers/scsi/device_handler/scsi_dh_rdac.c:482:
+ "MODE_SELECT failed with sense %02x/%02x/%02x.\n",sense_hdr.sense_key,
^
ERROR: space prohibited before that close parenthesis ')'
#155: FILE: drivers/scsi/device_handler/scsi_dh_rdac.c:483:
+ sense_hdr.asc, sense_hdr.ascq );
total: 3 errors, 1 warnings, 54 lines checked
I fixed all of this, but could you try running checkpatch.pl before
submitting, next time.
James
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-03-11 20:48 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2009-03-11 20:48 ` James Bottomley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox