Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 221478
b: refs/heads/master
c: b847917
h: refs/heads/master
v: v3
  • Loading branch information
Robert Jennings authored and James Bottomley committed Oct 25, 2010
1 parent e85d24c commit 51de978
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0ee31cb5df4b717de923266879964d0418c3308f
refs/heads/master: b8479178901557dc323a69ee254c1c732e85e0e5
9 changes: 9 additions & 0 deletions trunk/drivers/scsi/sr_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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!
*/
Expand Down

0 comments on commit 51de978

Please sign in to comment.