scsi_dh_rdac: Retry mode select for NO_SENSE, ABORTED_COMMAND, UNIT_ATTENTION, NOT_READY(02/04/01)
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.
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.
",
+ sense_hdr.sense_key, sense_hdr.asc, sense_hdr.ascq);
}
- if (sense)
- sdev_printk(KERN_INFO, sdev,
- "MODE_SELECT failed with sense 0x%x.
", sense);
done:
return err;
}
--
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
03-02-2009, 02:44 PM
Hannes Reinecke
scsi_dh_rdac: Retry mode select for NO_SENSE, ABORTED_COMMAND, UNIT_ATTENTION, NOT_READY(02/04/01)
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.
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?
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)
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
03-04-2009, 05:47 AM
"Chauhan, Vijay"
scsi_dh_rdac: Retry mode select for NO_SENSE, ABORTED_COMMAND, UNIT_ATTENTION, NOT_READY(02/04/01)
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.