Bug 9215 - 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
Summary: When trying to get the drive status via ioctl CDROM_DRIVE_STATUS, with no dis...
Status: CLOSED OBSOLETE
Alias: None
Product: IO/Storage
Classification: Unclassified
Component: SCSI (show other bugs)
Hardware: All Linux
: P1 high
Assignee: io_scsi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-23 23:58 UTC by Sergey A. Sukiyazov
Modified: 2012-05-12 16:21 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.10 and above
Subsystem:
Regression: No
Bisected commit-id:


Attachments

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)

Note You need to log in before you can comment on or make changes to this bug.