rpms/kernel/devel linux-2.6-cdrom-door-status.patch, NONE, 1.1 kernel.spec, 1.1033, 1.1034

Peter Jones pjones at fedoraproject.org
Thu Oct 9 17:00:45 UTC 2008


Author: pjones

Update of /cvs/extras/rpms/kernel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv6821

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6-cdrom-door-status.patch 
Log Message:
* Thu Oct 09 2008 Peter Jones <pjones at redhat.com>
- Fix the return code CD accesses when the CDROM drive door is closed
  but the drive isn't yet ready.


linux-2.6-cdrom-door-status.patch:

--- NEW FILE linux-2.6-cdrom-door-status.patch ---
>From e85e03d7f680b62bb8d4d037fdde6dd94c9582a3 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones at redhat.com>
Date: Wed, 8 Oct 2008 15:10:39 -0400
Subject: [PATCH] make sr_mod report more accurate drive status after closing the door.

So, what's happening here is that the drive is reporting a sense of
2/4/1 ("logical unit is becoming ready") from sr_test_unit_ready(), and
then we ask for the media event notification before checking that result
at all.  The check_media_event_descriptor() call isn't getting a check
condition, but it's also reporting that the tray is closed and that
there's no media.  In actuality it doesn't yet know if there's media or
not, but there's no way to express that in the media event status field.

My current thought is that if it told us the device isn't yet ready, we
should return that immediately, since there's nothing that'll tell us
any more data than that reliably.
---
 drivers/scsi/sr_ioctl.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/sr_ioctl.c b/drivers/scsi/sr_ioctl.c
index ae87d08..7ee51ff 100644
--- a/drivers/scsi/sr_ioctl.c
+++ b/drivers/scsi/sr_ioctl.c
@@ -309,6 +309,11 @@ int sr_drive_status(struct cdrom_device_info *cdi, int slot)
 	if (0 == sr_test_unit_ready(cd->device, &sshdr))
 		return CDS_DISC_OK;
 
+	/* SK/ASC/ASCQ of 2/4/1 means "unit is becoming ready" */
+	if (scsi_sense_valid(&sshdr) & sshdr.sense_key == NOT_READY
+			&& sshd.asc == 0x04 && sshd.ascq == 0x01)
+		return CDS_DRIVE_NOT_READY;
+
 	if (!cdrom_get_media_event(cdi, &med)) {
 		if (med.media_present)
 			return CDS_DISC_OK;
-- 
1.6.0.1



Index: kernel.spec
===================================================================
RCS file: /cvs/extras/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.1033
retrieving revision 1.1034
diff -u -r1.1033 -r1.1034
--- kernel.spec	9 Oct 2008 15:44:21 -0000	1.1033
+++ kernel.spec	9 Oct 2008 17:00:14 -0000	1.1034
@@ -634,6 +634,10 @@
 Patch1515: linux-2.6-lirc.patch
 Patch1520: linux-2.6-hdpvr.patch
 
+# Fix the return code CD accesses when the CDROM drive door is closed
+# but the drive isn't yet ready.
+Patch1550: linux-2.6-cdrom-door-status.patch
+
 # nouveau + drm fixes
 Patch1800: nvidia-agp.patch
 Patch1811: drm-modesetting-radeon.patch
@@ -1197,6 +1201,10 @@
 # http://hg.jannau.net/hdpvr/
 ApplyPatch linux-2.6-hdpvr.patch
 
+# Fix the return code CD accesses when the CDROM drive door is closed
+# but the drive isn't yet ready.
+ApplyPatch linux-2.6-cdrom-door-status.patch
+
 ApplyPatch linux-2.6-e1000-ich9.patch
 
 ApplyPatch linux-2.6-e1000e-add-support-for-the-82567LM-4-device.patch
@@ -1811,6 +1819,10 @@
 %kernel_variant_files -k vmlinux %{with_kdump} kdump
 
 %changelog
+* Thu Oct 09 2008 Peter Jones <pjones at redhat.com>
+- Fix the return code CD accesses when the CDROM drive door is closed
+  but the drive isn't yet ready.
+
 * Thu Oct 09 2008 Eric Sandeen <sandeen at redhat.com>
 - Fix for xfs wrongly disabling barriers while running.
 




More information about the fedora-extras-commits mailing list