diff options
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r-- | drivers/scsi/scsi_lib.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 7b0f9a3810d2..764a8b375ead 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -1067,16 +1067,29 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes, | |||
1067 | break; | 1067 | break; |
1068 | case NOT_READY: | 1068 | case NOT_READY: |
1069 | /* | 1069 | /* |
1070 | * If the device is in the process of becoming ready, | 1070 | * If the device is in the process of becoming |
1071 | * retry. | 1071 | * ready, or has a temporary blockage, retry. |
1072 | */ | 1072 | */ |
1073 | if (sshdr.asc == 0x04 && sshdr.ascq == 0x01) { | 1073 | if (sshdr.asc == 0x04) { |
1074 | scsi_requeue_command(q, cmd); | 1074 | switch (sshdr.ascq) { |
1075 | return; | 1075 | case 0x01: /* becoming ready */ |
1076 | case 0x04: /* format in progress */ | ||
1077 | case 0x05: /* rebuild in progress */ | ||
1078 | case 0x06: /* recalculation in progress */ | ||
1079 | case 0x07: /* operation in progress */ | ||
1080 | case 0x08: /* Long write in progress */ | ||
1081 | case 0x09: /* self test in progress */ | ||
1082 | scsi_requeue_command(q, cmd); | ||
1083 | return; | ||
1084 | default: | ||
1085 | break; | ||
1086 | } | ||
1076 | } | 1087 | } |
1077 | if (!(req->flags & REQ_QUIET)) | 1088 | if (!(req->flags & REQ_QUIET)) { |
1078 | scmd_printk(KERN_INFO, cmd, | 1089 | scmd_printk(KERN_INFO, cmd, |
1079 | "Device not ready.\n"); | 1090 | "Device not ready: "); |
1091 | scsi_print_sense_hdr("", &sshdr); | ||
1092 | } | ||
1080 | scsi_end_request(cmd, 0, this_count, 1); | 1093 | scsi_end_request(cmd, 0, this_count, 1); |
1081 | return; | 1094 | return; |
1082 | case VOLUME_OVERFLOW: | 1095 | case VOLUME_OVERFLOW: |