X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fscsi%2Fsr_ioctl.c;h=3cd8ffbad5776dbcee289f1465022602e3897199;hb=1bb95834bbcdc969e477a9284cf96c17a4c2616f;hp=cbb38c5197fad67299f32a36792ab1fc5cdeec3e;hpb=fc2a093e7ad23e935aa29e349bc27173c92f1a95;p=pandora-kernel.git 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 @@ -324,6 +324,15 @@ int sr_drive_status(struct cdrom_device_info *cdi, int slot) return CDS_NO_DISC; } + /* + * SK/ASC/ASCQ of 2/4/2 means "initialization required" + * Using CD_TRAY_OPEN results in an START_STOP_UNIT to close + * the tray, which resolves the initialization requirement. + */ + if (scsi_sense_valid(&sshdr) && sshdr.sense_key == NOT_READY + && sshdr.asc == 0x04 && sshdr.ascq == 0x02) + return CDS_TRAY_OPEN; + /* * 0x04 is format in progress .. but there must be a disc present! */