Hi James,
On Sun, 15 Jun 2008, James Bottomley wrote:
Reverting that commit doesn't fix the problem.
I tried the patch below.
Now the kernel spits out messages every 2 seconds:
| G: CDS_NO_DISC
| G: CDS_NO_DISC
Insert CD-DA media
Reading from CD using cdparanioa fails
| F: CDS_DISC_OK
| F: CDS_DISC_OK
| F: CDS_DISC_OK
| F: CDS_DISC_OK
| F: CDS_DISC_OK
Reading from CD starts to work here
| B: CDS_DISC_OK
| B: CDS_DISC_OK
I tried changing the return value in the `F' case to CDS_NO_DISC, but that
doesn't make a difference.
--- a/drivers/scsi/sr_ioctl.c 2008-06-16 16:34:01.000000000 +0200
+++ b/drivers/scsi/sr_ioctl.c 2008-06-16 16:59:28.000000000 +0200
@@ -304,25 +304,34 @@ int sr_drive_status(struct cdrom_device_
if (CDSL_CURRENT != slot) {
/* we have no changer support */
+printk("A: -EINVAL\n");
return -EINVAL;
}
- if (0 == sr_test_unit_ready(cd->device, &sshdr))
+ if (0 == sr_test_unit_ready(cd->device, &sshdr)) {
+printk("B: CDS_DISC_OK\n");
return CDS_DISC_OK;
+ }
if (!cdrom_get_media_event(cdi, &med)) {
- if (med.media_present)
+ if (med.media_present) {
+printk("C: CDS_DISC_OK\n");
return CDS_DISC_OK;
- else if (med.door_open)
+ } else if (med.door_open) {
+printk("D: CDS_TRAY_OPEN\n");
return CDS_TRAY_OPEN;
- else
+ } else {
+printk("E: CDS_NO_DISC\n");
return CDS_NO_DISC;
+ }
}
/*
* 0x04 is format in progress .. but there must be a disc present!
*/
- if (sshdr.sense_key == NOT_READY && sshdr.asc == 0x04)
+ if (sshdr.sense_key == NOT_READY && sshdr.asc == 0x04) {
+printk("F: CDS_DISC_OK\n");
return CDS_DISC_OK;
+ }
/*
* If not using Mt Fuji extended media tray reports,
@@ -331,11 +340,15 @@ int sr_drive_status(struct cdrom_device_
*/
if (scsi_sense_valid(&sshdr) &&
/* 0x3a is medium not present */
- sshdr.asc == 0x3a)
+ sshdr.asc == 0x3a) {
+printk("G: CDS_NO_DISC\n");
return CDS_NO_DISC;
- else
+ } else {
+printk("H: CDS_TRAY_OPEN\n");
return CDS_TRAY_OPEN;
+ }
+printk("I: CDS_DRIVE_NOT_READY\n");
return CDS_DRIVE_NOT_READY;
}
With kind regards,
Geert Uytterhoeven
Software Architect
Sony Techsoft Centre
The Corporate Village