diff options
author | Chauhan, Vijay <Vijay.Chauhan@lsi.com> | 2009-03-04 01:47:54 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-03-12 13:58:23 -0400 |
commit | 7687fb9209422d35334995b8ace38de92e595d16 (patch) | |
tree | 92bb117af7855d8b474b7c81c582bb3a4f1ce48b /drivers/scsi/device_handler | |
parent | 0282985da5923fa6365adcc1a1586ae0c13c1617 (diff) |
[SCSI] 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 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>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/device_handler')
-rw-r--r-- | drivers/scsi/device_handler/scsi_dh_rdac.c | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/drivers/scsi/device_handler/scsi_dh_rdac.c b/drivers/scsi/device_handler/scsi_dh_rdac.c index f2b9d197e80a..07962f675fef 100644 --- a/drivers/scsi/device_handler/scsi_dh_rdac.c +++ b/drivers/scsi/device_handler/scsi_dh_rdac.c | |||
@@ -449,28 +449,40 @@ static int mode_select_handle_sense(struct scsi_device *sdev, | |||
449 | unsigned char *sensebuf) | 449 | unsigned char *sensebuf) |
450 | { | 450 | { |
451 | struct scsi_sense_hdr sense_hdr; | 451 | struct scsi_sense_hdr sense_hdr; |
452 | int sense, err = SCSI_DH_IO, ret; | 452 | int err = SCSI_DH_IO, ret; |
453 | 453 | ||
454 | ret = scsi_normalize_sense(sensebuf, SCSI_SENSE_BUFFERSIZE, &sense_hdr); | 454 | ret = scsi_normalize_sense(sensebuf, SCSI_SENSE_BUFFERSIZE, &sense_hdr); |
455 | if (!ret) | 455 | if (!ret) |
456 | goto done; | 456 | goto done; |
457 | 457 | ||
458 | err = SCSI_DH_OK; | 458 | err = SCSI_DH_OK; |
459 | sense = (sense_hdr.sense_key << 16) | (sense_hdr.asc << 8) | | 459 | |
460 | sense_hdr.ascq; | 460 | switch (sense_hdr.sense_key) { |
461 | /* If it is retryable failure, submit the c9 inquiry again */ | 461 | case NO_SENSE: |
462 | if (sense == 0x59136 || sense == 0x68b02 || sense == 0xb8b02 || | 462 | case ABORTED_COMMAND: |
463 | sense == 0x62900) { | 463 | case UNIT_ATTENTION: |
464 | /* 0x59136 - Command lock contention | ||
465 | * 0x[6b]8b02 - Quiesense in progress or achieved | ||
466 | * 0x62900 - Power On, Reset, or Bus Device Reset | ||
467 | */ | ||
468 | err = SCSI_DH_RETRY; | 464 | err = SCSI_DH_RETRY; |
465 | break; | ||
466 | case NOT_READY: | ||
467 | if (sense_hdr.asc == 0x04 && sense_hdr.ascq == 0x01) | ||
468 | /* LUN Not Ready and is in the Process of Becoming | ||
469 | * Ready | ||
470 | */ | ||
471 | err = SCSI_DH_RETRY; | ||
472 | break; | ||
473 | case ILLEGAL_REQUEST: | ||
474 | if (sense_hdr.asc == 0x91 && sense_hdr.ascq == 0x36) | ||
475 | /* | ||
476 | * Command Lock contention | ||
477 | */ | ||
478 | err = SCSI_DH_RETRY; | ||
479 | break; | ||
480 | default: | ||
481 | sdev_printk(KERN_INFO, sdev, | ||
482 | "MODE_SELECT failed with sense %02x/%02x/%02x.\n", | ||
483 | sense_hdr.sense_key, sense_hdr.asc, sense_hdr.ascq); | ||
469 | } | 484 | } |
470 | 485 | ||
471 | if (sense) | ||
472 | sdev_printk(KERN_INFO, sdev, | ||
473 | "MODE_SELECT failed with sense 0x%x.\n", sense); | ||
474 | done: | 486 | done: |
475 | return err; | 487 | return err; |
476 | } | 488 | } |