diff options
author | James Bottomley <James.Bottomley@steeleye.com> | 2006-04-25 17:48:30 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-04-27 14:58:40 -0400 |
commit | f3e93f735321ea75108b41cb654c16f92d3f264c (patch) | |
tree | f3b2f0b4e83db4c564ee0411a36dda881a1af34d /drivers/scsi | |
parent | 4a6fae1d9c0d879d5d46a2a4962220dbf53ac72b (diff) |
[SCSI] Fix DVD burning issues.
Some pioneer DVDs are apparently returning odd "not ready" status
codes that the mid-layer doesn't recognise and so passes back to the
user as errors.
This patch overhauls our not-ready handling and adds transparent retries for:
format in progress
rebuild in progress
recalculation in progress
operation in progress
Long write in progress
self test in progress
The Pioneer was actually returning "long write in progress"
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi')
-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: |