|Summary:||ioctl CDROM_DRIVE_STATUS, with no disk gives CDS_TRAY_OPEN even if the tray is closed on SATA/SCSI devices|
|Product:||Gentoo Linux||Reporter:||Sergey A. Sukiyazov <sukiyazov>|
|Component:||[OLD] Core system||Assignee:||Gentoo Kernel Bug Wranglers and Kernel Maintainers <kernel>|
|Package list:||Runtime testing required:||---|
Description Sergey A. Sukiyazov 2007-10-24 06:29:13 UTC
>From David Martin <> Subject [PATCH] SCSI not showing tray status correctly Date Mon, 27 Dec 2004 06:26:32 +0100 Digg This 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. 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 Mike Pagano 2007-10-25 00:24:03 UTC
Submission of patch to lkml: http://lkml.org/lkml/2004/12/27/1
Comment 2 Maarten Bressers (RETIRED) 2007-10-25 22:35:50 UTC
The patch has been sent upstream (again), we'll wait for their response.
Comment 3 Mike Pagano 2007-12-19 19:23:18 UTC
submission thread: http://lkml.org/lkml/2007/10/27/219
Comment 4 Daniel Drake (RETIRED) 2008-01-24 13:20:30 UTC
Created attachment 141718 [details, diff] patch Sorry for the delay here. Please apply this patch instead, and confirm it solves the issue.
Comment 5 Daniel Drake (RETIRED) 2008-02-07 11:49:22 UTC
I went ahead and tested this myself. It needed some extra work (another patch backported first, and a fix applying after), but it's done now. Patches 2100, 2101, and 2102 queued for next gentoo-sources-2.6.24 release
Comment 6 Daniel Drake (RETIRED) 2008-02-10 00:39:13 UTC
Fixed in gentoo-sources-2.6.24-r1 (genpatches-2.6.24-2) Not planning on backporting to 2.6.23 as this is more than a simple bugfix.