]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/scsi/sr_ioctl.c
Merge branch 'master' into csb1725
[mv-sheeva.git] / drivers / scsi / sr_ioctl.c
index cbb38c5197fad67299f32a36792ab1fc5cdeec3e..3cd8ffbad5776dbcee289f1465022602e3897199 100644 (file)
@@ -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!
         */