linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Douglas Gilbert <dougg@torque.net>
To: linux-scsi@vger.kernel.org
Cc: axboe@suse.de
Subject: strange ide-cd MODE_SENSE response [2.6.8.1]
Date: Tue, 17 Aug 2004 12:54:01 +1000	[thread overview]
Message-ID: <41217349.4060302@torque.net> (raw)

In lk 2.6.8.1 (and 2.6.7) if a MODE_SENSE (6 byte variant) is sent
to an "ide-cd" device (e.g. /dev/hdc) then it responds with a
"CONDITION MET" SCSI status and no sense buffer.

According to MMC, MODE_SENSE (6) is not supported. In this case a
polite SCSI device should set a SCSI status of "CHECK CONDITION"
with a sense key of ILLEGAL_REQUEST and appropriate ASC/ASCQ
values (i.e. operation code not supported).

The relevant code in ide-cd.c seems to be:

         /*
          * it's silly to pretend we understand 6-byte sense commands, just
          * reject with ILLEGAL_REQUEST and the caller should take the
          * appropriate action
          */
         if (c[0] == MODE_SENSE || c[0] == MODE_SELECT) {
                 rq->errors = ILLEGAL_REQUEST;
                 return BLKPREP_KILL;
         }

I couldn't see how that BLKPREP_KILL was processed.

Why have such code? I have a Yamaha SCSI cd writer that
correctly supports MODE_SENSE (6) and MODE_SENSE (10).
Support for MODE_SENSE (10) is mandatory in the MMC
standard but it would be surprising if it said a
MMC device could _not_ support MODE_SENSE (6).

The failure can be seen with the sg3_utils package and
commands like this:
    sg_modes -6 /dev/hdc
    sginfo -C -6 /dev/hdc


Doug Gilbert


             reply	other threads:[~2004-08-17  8:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-17  2:54 Douglas Gilbert [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-08-17 22:35 strange ide-cd MODE_SENSE response [2.6.8.1] Pat LaVarre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41217349.4060302@torque.net \
    --to=dougg@torque.net \
    --cc=axboe@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).