Re: [linux-usb-devel] Re: /dev/sr0 not ready, but working

From: Alan Stern
Date: Thu Nov 24 2005 - 12:28:44 EST


On Thu, 24 Nov 2005, Mark Lord wrote:

> Jeff Garzik wrote:

> > The difference is between ide-cd.c and sr.c, most likely.
>
> Agreed. I get hundreds and hundreds of these when simply playing a DVD:
>
> sr0: CDROM not ready. Make sure there is a disc in the drive.
>
> Nothing really wrong here, other than that the kernel is flooding
> my syslogs with messages that could really be left to the userspace
> application to decide about.

If any of you is interested in pursuing this, try out this patch. It will
tell what the offending command is and how it is getting submitted. Once
that is known, the generic cdrom layer or the sr driver can be changed to
suppress these warnings.

Alan Stern



--- a/drivers/scsi/sr_ioctl.c Mon Oct 31 10:12:20 2005
+++ b/drivers/scsi/sr_ioctl.c Thu Nov 24 12:24:59 2005
@@ -139,8 +139,15 @@
break;
}
}
- if (!cgc->quiet)
- printk(KERN_INFO "%s: CDROM not ready. Make sure there is a disc in the drive.\n", cd->cdi.name);
+ if (!cgc->quiet) {
+ static int cnt = 0;
+ if (cnt < 8) {
+ ++cnt;
+ printk(KERN_INFO "%s: CDROM not ready. Make sure there is a disc in the drive.\n", cd->cdi.name);
+ printk("cmd[0] = %d\n", cgc->cmd[0]);
+ dump_stack();
+ }
+ }
#ifdef DEBUG
scsi_print_sense_hdr("sr", &sshdr);
#endif

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/