[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>

authored by James Bottomley and committed by James Bottomley f3e93f73 4a6fae1d

+20 -7
+20 -7
drivers/scsi/scsi_lib.c
··· 1067 1067 break; 1068 1068 case NOT_READY: 1069 1069 /* 1070 - * If the device is in the process of becoming ready, 1071 - * retry. 1070 + * If the device is in the process of becoming 1071 + * ready, or has a temporary blockage, retry. 1072 1072 */ 1073 - if (sshdr.asc == 0x04 && sshdr.ascq == 0x01) { 1074 - scsi_requeue_command(q, cmd); 1075 - return; 1073 + if (sshdr.asc == 0x04) { 1074 + switch (sshdr.ascq) { 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 1089 scmd_printk(KERN_INFO, cmd, 1079 - "Device not ready.\n"); 1090 + "Device not ready: "); 1091 + scsi_print_sense_hdr("", &sshdr); 1092 + } 1080 1093 scsi_end_request(cmd, 0, this_count, 1); 1081 1094 return; 1082 1095 case VOLUME_OVERFLOW: