------=_NextPart_000_00B1_01BFCD83.8F484030
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
----- Original Message -----=20
From: "G=E9rard 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]
>=20
>=20
> On Sat, 27 May 2000, Jens Axboe wrote:
>=20
> > 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.
> > >=20
> > > 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.
>=20
> Why only removable ?
> It is intended to check if media can be accessed, regardless the media
> type.
>=20
> > > 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).
> >=20
> > Looks good to me. Although I can't possibly see what harm a =
TEST_UNIT_READY
> > command could do...
>=20
> 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).
>=20
> 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.
>=20
> 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. =20
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
------=_NextPart_000_00B1_01BFCD83.8F484030
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
7.5.3 Selection of an invalid logical = unit
The target’s response to = selection of a=20 logical unit that is not valid is described in the following=20 paragraphs.
The logical unit may not be valid because:
a) the target does not support = the logical=20 unit (e.g. some targets support only one peripheral device). In = response
to=20 an INQUIRY command, the target shall return the INQUIRY data with the=20 peripheral qualifier set to the value
required in 8.2.5.1. In = response to=20 any other command except REQUEST SENSE, the target shall = terminate
the=20 command with CHECK CONDITION status. In response to a REQUEST SENSE = command,=20 the target shall
return sense data. The sense key shall be set to = ILLEGAL=20 REQUEST and the additional sense code shall be
set to LOGICAL UNIT = NOT=20 SUPPORTED.
b) the target supports the = logical unit, but=20 the peripheral device is not currently attached to the target. In=20 response
to an INQUIRY command, the target shall return the INQUIRY = data=20 with the peripheral qualifier set to the value
required in 8.2.5.1. = In=20 response to any other command except REQUEST SENSE, the target shall=20 terminate
the command with CHECK CONDITION status. In response to a = REQUEST=20 SENSE command, the target shall
return sense data. The sense key = shall be=20 set to ILLEGAL REQUEST and the additional sense code shall be
set = to=20 LOGICAL UNIT NOT SUPPORTED.
c) the target supports the = logical unit and=20 the peripheral device is attached, but not operational. In response = to
an=20 INQUIRY command, the target shall return the INQUIRY data with the = peripheral=20 qualifier set to the value
required in 8.2.5.1. The target’s = response to=20 any command other than INQUIRY and REQUEST SENSE=20 is
vendor-specific.
d) the target supports the = logical unit but=20 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=20 target shall return the INQUIRY data
with the peripheral qualifier = set to=20 the value required in 8.2.5.1. In response to a REQUEST SENSE = command,
the=20 target shall return the REQUEST SENSE data with a sense key of NO = SENSE unless=20 a contingent
allegiance exists. The target’s response to any = other command=20 is vendor-specific.