----- Original Message -----
From: "Gérard Roudier" <groudier@club-internet.fr>
To: "Jens Axboe" <axboe@suse.de>
Cc: "Paul Gortmaker" <p_gortmaker@yahoo.com>; "Alan Cox" <alan@lxorguk.ukuu.org.uk>; <linux-kernel@vger.rutgers.edu>; <linux-scsi@vger.rutgers.edu>
Sent: Saturday, May 27, 2000 5:44 PM
Subject: Re: LINUX Jobs for 2.4 update [scsi]
>
>
> On Sat, 27 May 2000, Jens Axboe wrote:
>
> > On Sat, May 27 2000, Paul Gortmaker wrote:
> > > > To Do
> > > > -----
> > > > Linux uses TEST_UNIT_READY to chck for device presence on a PUN/LUN. The
> > > > INQUIRY is the only valid test allowed by the spec.
> > >
> > > The draft of SCSI-2 spec I have here hints that INQUIRY should be used
> > > to probe system configuration and that TEST_UNIT_READY is more for
> > > polling on devices with removable media.
>
> Why only removable ?
> It is intended to check if media can be accessed, regardless the media
> type.
>
> > > I tossed the TEST_UNIT_READY
> > > part out and INQUIRY alone works fine (one disk, 2 CDs and a tape on
> > > a BusLogic clone - all found as per usual).
> >
> > Looks good to me. Although I can't possibly see what harm a TEST_UNIT_READY
> > command could do...
>
> TEST UNIT READY seems not appropriate for the discovery of devices. It
> also may return CHECK CONDITION when INQUIRY will succeed (and preserve a
> UNIT ATTENTION CONDITION if any).
>
> On the other hand, it may be risky to try a TUR on an not existing LUN,
> given that SCSI devices usually expect INQUIRY. Broken SCSI device
> firmwares may arm on a TUR to a non existing LUN but not harm on an
> INQUIRY.
>
> INQUIRY will not fail is a device is here. If the device is not ready,
> INQUIRY may well be the the only command the device wants to accept.
The main problem with not using TUR is that I believe that INQUIRY is not required to be sensitive to the LUN number. In other words, an INQUIRY in order to detect whether a lun is actually present at a given lun number, you also need to do a TUR.
I tried digging around in the standards to find something which describes this situation. Section 7.5.3 (Selection of an invalid logical unit) seems to cover this a little bit:
7.5.3 Selection of an invalid logical unit
The target's response to selection of a logical unit that is not valid is described in the following paragraphs.
The logical unit may not be valid because:
a) the target does not support the logical unit (e.g. some targets support only one peripheral device). In response
to an INQUIRY command, the target shall return the INQUIRY data with the peripheral qualifier set to the value
required in 8.2.5.1. In response to any other command except REQUEST SENSE, the target shall terminate
the command with CHECK CONDITION status. In response to a REQUEST SENSE command, the target shall
return sense data. The sense key shall be set to ILLEGAL REQUEST and the additional sense code shall be
set to LOGICAL UNIT NOT SUPPORTED.
b) the target supports the logical unit, but the peripheral device is not currently attached to the target. In response
to an INQUIRY command, the target shall return the INQUIRY data with the peripheral qualifier set to the value
required in 8.2.5.1. In response to any other command except REQUEST SENSE, the target shall terminate
the command with CHECK CONDITION status. In response to a REQUEST SENSE command, the target shall
return sense data. The sense key shall be set to ILLEGAL REQUEST and the additional sense code shall be
set to LOGICAL UNIT NOT SUPPORTED.
c) the target supports the logical unit and the peripheral device is attached, but not operational. In response to
an INQUIRY command, the target shall return the INQUIRY data with the peripheral qualifier set to the value
required in 8.2.5.1. The target's response to any command other than INQUIRY and REQUEST SENSE is
vendor-specific.
d) the target supports the logical unit but is incapable of determining if the peripheral device is attached or is not
operational when it is not ready. In response to an INQUIRY command,the target shall return the INQUIRY data
with the peripheral qualifier set to the value required in 8.2.5.1. In response to a REQUEST SENSE command,
the target shall return the REQUEST SENSE data with a sense key of NO SENSE unless a contingent
allegiance exists. The target's response to any other command is vendor-specific.
Reversing the order of the INQUIRY/TUR wouldn't hurt anything I guess. Eliminating it altogether seems dangerous.
In SCSI-3, there is now a command that can be used to ask a device what logical units are present.
-Eric
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Wed Jun 07 2000 - 21:00:17 EST