strange ide-cd MODE_SENSE response [2.6.8.1]
From: Douglas Gilbert <hidden>
Date: 2004-08-17 08:19:24
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