aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/sr_ioctl.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/scsi/sr_ioctl.c b/drivers/scsi/sr_ioctl.c
index cbb38c5197fa..3cd8ffbad577 100644
--- a/drivers/scsi/sr_ioctl.c
+++ b/drivers/scsi/sr_ioctl.c
@@ -325,6 +325,15 @@ int sr_drive_status(struct cdrom_device_info *cdi, int slot)
325 } 325 }
326 326
327 /* 327 /*
328 * SK/ASC/ASCQ of 2/4/2 means "initialization required"
329 * Using CD_TRAY_OPEN results in an START_STOP_UNIT to close
330 * the tray, which resolves the initialization requirement.
331 */
332 if (scsi_sense_valid(&sshdr) && sshdr.sense_key == NOT_READY
333 && sshdr.asc == 0x04 && sshdr.ascq == 0x02)
334 return CDS_TRAY_OPEN;
335
336 /*
328 * 0x04 is format in progress .. but there must be a disc present! 337 * 0x04 is format in progress .. but there must be a disc present!
329 */ 338 */
330 if (sshdr.sense_key == NOT_READY && sshdr.asc == 0x04) 339 if (sshdr.sense_key == NOT_READY && sshdr.asc == 0x04)