Bug 9215

Summary: When trying to get the drive status via ioctl CDROM_DRIVE_STATUS, with no disk it gives CDS_TRAY_OPEN even if the tray is closed on SATA/SCSI devices
Product: IO/Storage Reporter: Sergey A. Sukiyazov (sukiyazov)
Component: SCSIAssignee: io_scsi
Status: CLOSED OBSOLETE    
Severity: high CC: alan
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.10 and above Subsystem:
Regression: No Bisected commit-id:

Description Sergey A. Sukiyazov 2007-10-23 23:58:02 UTC
Most recent kernel where this bug did not occur:
Distribution: 2.6.10
Hardware Environment: SATA/SCSI CDROM (which uses sr_mod)
Software Environment: 

Problem Description:
When trying to get the drive status via ioctl CDROM_DRIVE_STATUS, with no disk 
it gives CDS_TRAY_OPEN even if the tray is closed.

ioctl works as expected with ide-cd driver. Here is the patch to get the same 
behaviour on SCSI drives for kernel 2.6.10. 2.4 branch have same problem.

Get from Debian bug #447337
(http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=447337)

Reproducible: Always

Steps to Reproduce:
1. Close empty CD tray.
2. call state = ioctl(device_handle, CDROM_DRIVE_STATUS);
3. state always gives CDS_TRAY_OPEN even if the tray is closed.

Resolve:
Patch for solve this problem present at Debian bug #447337 by URL:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=447337

I apply this patch. It work correctly. Now ioctl(device_handle,
CDROM_DRIVE_STATUS) returns right result.
Comment 1 Sergey A. Sukiyazov 2007-10-24 00:07:54 UTC
(In reply to comment #0)
> Most recent kernel where this bug did not occur:
> Distribution: 2.6.10
> Hardware Environment: SATA/SCSI CDROM (which uses sr_mod)
> Software Environment: 
Sorry...

Distribution: Gentoo 2007.0, kernel 2.6.22-gentoo-r8
Hardware Environment: SATA/SCSI CDROM (which uses sr_mod)