Something basic about SCSI has confused me for a while. Is REQUEST
SENSE required to clear a unit attention condition or is TEST UNIT
READY sufficient? What I read in SAM-3 implies yes, but what I've
seen with a real device implies no.
I once wrote driver code for a USB CD-ROM drive, which uses SCSI as
its command set. When I changed the media in the drive, all I had to
do to get READ and WRITE commands to succeed was to beforehand issue
TEST UNIT READY a few times until it finally succeeded.
This confuses me because I thought changing media was supposed to
establish a unit attention condition, which should have caused those
READ and WRITE commands to fail with check condition status until I
did a REQUEST SENSE, but I never did a REQUEST SENSE. Am I
interpreting the spec wrong, or did the device and I both violate it?
|
|
0
|
|
|
|
Reply
|
BubbaGump
|
2/17/2007 2:12:13 AM |
|
"BubbaGump" <BubbaGump@localhost> wrote in message
news:5loct2prat2m67ptoo36t3kq3oa5mhl3ra@4ax.com...
> Something basic about SCSI has confused me for a while. Is REQUEST
> SENSE required to clear a unit attention condition or is TEST UNIT
> READY sufficient? What I read in SAM-3 implies yes, but what I've
> seen with a real device implies no.
>
> I once wrote driver code for a USB CD-ROM drive, which uses SCSI as
> its command set. When I changed the media in the drive, all I had to
> do to get READ and WRITE commands to succeed was to beforehand issue
> TEST UNIT READY a few times until it finally succeeded.
>
> This confuses me because I thought changing media was supposed to
> establish a unit attention condition, which should have caused those
> READ and WRITE commands to fail with check condition status until I
> did a REQUEST SENSE, but I never did a REQUEST SENSE. Am I
> interpreting the spec wrong, or did the device and I both violate it?
>
When a Unit Attention condition exists (reset, power cycle, whatever), the
next SCSI command that is not a REQUEST SENSE or an INQUIRY command will
fail with a Check condition.
If you first command routinely is a TEST UNIT READY, this TUR will end in a
Check Condition and you can then choose to issue a REQUEST SENSE to pick up
the sense data and find out exactly what the condition was. You can also
choose to ignore the Check condition.
The SCSI command after that will not be 'bothered' with the fact that sense
data is available, and it will be processed as usual. At this point any
sense data that could have informed you of the Unit Attention is cleared.
Rob
|
|
0
|
|
|
|
Reply
|
Rob
|
2/17/2007 7:56:41 AM
|
|
On Sat, 17 Feb 2007 08:56:41 +0100, "Rob Turk"
<wipe_this_r.turk@chello.nl> wrote:
>"BubbaGump" <BubbaGump@localhost> wrote in message
>news:5loct2prat2m67ptoo36t3kq3oa5mhl3ra@4ax.com...
>> Something basic about SCSI has confused me for a while. Is REQUEST
>> SENSE required to clear a unit attention condition or is TEST UNIT
>> READY sufficient? What I read in SAM-3 implies yes, but what I've
>> seen with a real device implies no.
>>
>> I once wrote driver code for a USB CD-ROM drive, which uses SCSI as
>> its command set. When I changed the media in the drive, all I had to
>> do to get READ and WRITE commands to succeed was to beforehand issue
>> TEST UNIT READY a few times until it finally succeeded.
>>
>> This confuses me because I thought changing media was supposed to
>> establish a unit attention condition, which should have caused those
>> READ and WRITE commands to fail with check condition status until I
>> did a REQUEST SENSE, but I never did a REQUEST SENSE. Am I
>> interpreting the spec wrong, or did the device and I both violate it?
>>
>
>When a Unit Attention condition exists (reset, power cycle, whatever), the
>next SCSI command that is not a REQUEST SENSE or an INQUIRY command will
>fail with a Check condition.
>
>If you first command routinely is a TEST UNIT READY, this TUR will end in a
>Check Condition and you can then choose to issue a REQUEST SENSE to pick up
>the sense data and find out exactly what the condition was. You can also
>choose to ignore the Check condition.
>
>The SCSI command after that will not be 'bothered' with the fact that sense
>data is available, and it will be processed as usual. At this point any
>sense data that could have informed you of the Unit Attention is cleared.
That's a little closer than SAM-3 to a language I can understand, but
let me ask in other words. Is it correct to say that the first
command sent after a unit attention condition has occurred will be
failed, then the following command(s) will be processed normally?
(not including commands like INQUIRY, REPORT LUNS, or REQUEST SENSE or
a UA_INTLCK_CTR that is for some reason non-zero)
|
|
0
|
|
|
|
Reply
|
BubbaGump
|
2/17/2007 2:53:30 PM
|
|
|
2 Replies
489 Views
(page loaded in 0.032 seconds)
|