Commit:     76ca1af10e28021e1894c5703da42b5e7bff1771
Parent:     23450319e2890986c247ec0aa1442f060e657e6d
Author:     Stuart Hayes <[EMAIL PROTECTED]>
AuthorDate: Tue Apr 10 22:38:43 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Tue Apr 10 22:38:43 2007 +0200

    ide: ugly messages trying to open CD drive with no media present
    I get the following error messages when trying to open a CD device
    (specifically, the Teac CD-ROM CD-224E) that has no media present:
    hda: packet command error: status=3D0x51 { DriveReady SeekComplete Error }
    hda: packet command error: error=3D0x54 { AbortedCommand 
LastFailedSense=0x05 }
    ide: failed opcode was: unknown
    This happens when a "start stop unit" command (0x1b 0 0 0 3 0 0 0 0 0)
    is sent to the drive to try to close the CD-ROM tray, but this drive
    doesn't have that capability (it's a slim portable-type CD-ROM), so it
    reports sense key 5 (illegal request) with asc/ascq 24/0.  This is
    exactly how SFF8090i says it should respond.
    But ide-cd.c (in cdrom_decode_status() ) just sees sense key 5 and spews
    out an error.  It then goes on to request sense data, and
    cdrom_log_sense() understands this error and doesn't log it.
    The patch, for kernel, suppresses this error message.
    Signed-off-by: Stuart Hayes <[EMAIL PROTECTED]>
    Cc: Alan Cox <[EMAIL PROTECTED]>
    Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
 drivers/ide/ide-cd.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 45a928c..638becd 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -735,6 +735,15 @@ static int cdrom_decode_status(ide_drive_t *drive, int 
good_stat, int *stat_ret)
                        cdrom_saw_media_change (drive);
                        /*printk("%s: media changed\n",drive->name);*/
                        return 0;
+               } else if ((sense_key == ILLEGAL_REQUEST) &&
+                          (rq->cmd[0] == GPCMD_START_STOP_UNIT)) {
+                       /*
+                        * Don't print error message for this condition--
+                        * SFF8090i indicates that 5/24/00 is the correct
+                        * response to a request to close the tray if the
+                        * drive doesn't have that capability.
+                        * cdrom_log_sense() knows this!
+                        */
                } else if (!(rq->cmd_flags & REQ_QUIET)) {
                        /* Otherwise, print an error. */
                        ide_dump_status(drive, "packet command error", stat);
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to