On Sat, Oct 14 2000, Jeff V. Merkey wrote:
> With ide-scsi loaded, and after exiting gnome (where I attempted to read
> an IDE CD-DVD drive from gnome), I see the following messages in the
> var/log/messages file that repeat over and over again:
> 
> Jeff
> 
> Oct 14 00:47:27 manos kernel:   "25 00 00 00 00 00 00 00 00 00 00 00 " 
> Oct 14 00:47:29 manos kernel: ATAPI device hdd: 
> Oct 14 00:47:29 manos kernel:   Error: Not ready -- (Sense key=0x02) 
> Oct 14 00:47:29 manos kernel:   (reserved error code) -- (asc=0x3a, ascq=0x01) 
Medium not present, tray closed. Not a very interesting error. I've
started exluding non-critical errors from being dumped to the log
from ide-cd, the patch against 2.2.18-pre15 is attached here. Untested,
but compiles.

-- 
* Jens Axboe <[EMAIL PROTECTED]>
* SuSE Labs
--- /opt/kernel/linux-2.2.18-pre15/drivers/block/ide-cd.c       Tue Oct  3 14:05:23 
2000
+++ drivers/block/ide-cd.c      Sat Oct 14 14:22:42 2000
@@ -324,41 +324,47 @@
        info->nsectors_buffered = 0;
 }
 
+static int cdrom_log_sense(ide_drive_t *drive, struct packet_command *pc,
+                          struct request_sense *sense)
+{
+       int log = 0;
+
+       switch (sense->sense_key) {
+               case NO_SENSE: case RECOVERED_ERROR:
+                       break;
+               case NOT_READY:
+                       /*
+                        * don't care about tray state messages for
+                        * e.g. capacity commands or in-progress or
+                        * becoming ready
+                        */
+                       if (sense->asc == 0x3a || sense->asc == 0x04)
+                               break;
+                       log = 1;
+                       break;
+               case UNIT_ATTENTION:
+                       /*
+                        * Make good and sure we've seen this potential media
+                        * change. Some drives (i.e. Creative) fail to present
+                        * the correct sense key in the error register.
+                        */
+                       cdrom_saw_media_change(drive);
+                       break;
+               default:
+                       log = 1;
+                       break;
+       }
+       return log;
+}
 
 static
 void cdrom_analyze_sense_data(ide_drive_t *drive,
                              struct packet_command *failed_command,
                              struct request_sense *sense)
 {
-       if (sense->sense_key == NOT_READY ||
-           sense->sense_key == UNIT_ATTENTION) {
-               /* Make good and sure we've seen this potential media change.
-                  Some drives (i.e. Creative) fail to present the correct
-                  sense key in the error register. */
-               cdrom_saw_media_change (drive);
-
-
-               /* Don't print not ready or unit attention errors for
-                  READ_SUBCHANNEL.  Workman (and probably other programs)
-                  uses this command to poll the drive, and we don't want
-                  to fill the syslog with useless errors. */
-               if (failed_command &&
-                   (failed_command->c[0] == GPCMD_READ_SUBCHANNEL ||
-                    failed_command->c[0] == GPCMD_TEST_UNIT_READY))
-                       return;
-       }
-
-       if (sense->error_code == 0x70 && sense->sense_key  == 0x02
-        && ((sense->asc      == 0x3a && sense->ascq       == 0x00) ||
-            (sense->asc      == 0x04 && sense->ascq       == 0x01)))
-       {
-               /*
-                * Suppress the following errors:
-                * "Medium not present", "in progress of becoming ready",
-                * and "writing" to keep the noise level down to a dull roar.
-                */
+
+       if (!cdrom_log_sense(drive, failed_command, sense))
                return;
-       }
 
 #if VERBOSE_IDE_CD_ERRORS
        {
@@ -1105,7 +1111,13 @@
 
        if (retry && jiffies - info->start_seek > IDECD_SEEK_TIMER) {
                if (--retry == 0) {
+                       /*
+                        * this condition is far too common, to bother
+                        * users about it
+                        */
+#if 0
                        printk("%s: disabled DSC seek overlap\n", drive->name);
+#endif
                        drive->dsc_overlap = 0;
                }
        }

Reply via email to