[8939] in linux-scsi channel archive

home help back first fref pref prev next nref lref last post

Re: LINUX Jobs for 2.4 update [scsi]

daemon@ATHENA.MIT.EDU (Eric Youngdale)
Sat Jun 3 17:47:58 2000

Message-ID: <00b401bfcda5$16cc5110$0f17a8c0@eric.home>
From: "Eric Youngdale" <eric@andante.org>
To: =?iso-8859-1?Q?G=E9rard_Roudier?= <groudier@club-internet.fr>,
	"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>
Date:	Sat, 3 Jun 2000 17:45:51 -0400
MIME-Version: 1.0
Content-Type: multipart/alternative;
	boundary="----=_NextPart_000_00B1_01BFCD83.8F484030"

This is a multi-part message in MIME format.

------=_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">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2919.6307" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>----- Original Message ----- </FONT>
<DIV><FONT face=3DArial size=3D2>From: "G=E9rard Roudier" &lt;</FONT><A=20
href=3D"mailto:groudier@club-internet.fr"><FONT face=3DArial=20
size=3D2>groudier@club-internet.fr</FONT></A><FONT face=3DArial=20
size=3D2>&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>To: "Jens Axboe" &lt;</FONT><A=20
href=3D"mailto:axboe@suse.de"><FONT face=3DArial=20
size=3D2>axboe@suse.de</FONT></A><FONT face=3DArial =
size=3D2>&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Cc: "Paul Gortmaker" &lt;</FONT><A=20
href=3D"mailto:p_gortmaker@yahoo.com"><FONT face=3DArial=20
size=3D2>p_gortmaker@yahoo.com</FONT></A><FONT face=3DArial =
size=3D2>&gt;; "Alan Cox"=20
&lt;</FONT><A href=3D"mailto:alan@lxorguk.ukuu.org.uk"><FONT =
face=3DArial=20
size=3D2>alan@lxorguk.ukuu.org.uk</FONT></A><FONT face=3DArial =
size=3D2>&gt;;=20
&lt;</FONT><A href=3D"mailto:linux-kernel@vger.rutgers.edu"><FONT =
face=3DArial=20
size=3D2>linux-kernel@vger.rutgers.edu</FONT></A><FONT face=3DArial =
size=3D2>&gt;;=20
&lt;</FONT><A href=3D"mailto:linux-scsi@vger.rutgers.edu"><FONT =
face=3DArial=20
size=3D2>linux-scsi@vger.rutgers.edu</FONT></A><FONT face=3DArial=20
size=3D2>&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Sent: Saturday, May 27, 2000 5:44 =
PM</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Subject: Re: LINUX Jobs for 2.4 update=20
[scsi]</FONT></DIV></DIV>
<DIV><BR></DIV>
<DIV><FONT face=3DArial size=3D2>&gt; <BR>&gt; <BR>&gt; On Sat, 27 May =
2000, Jens=20
Axboe wrote:<BR>&gt; <BR>&gt; &gt; On Sat, May 27 2000, Paul Gortmaker=20
wrote:<BR>&gt; &gt; &gt; &gt; To Do<BR>&gt; &gt; &gt; &gt; -----<BR>&gt; =
&gt;=20
&gt; &gt; Linux uses TEST_UNIT_READY to chck for device presence on a =
PUN/LUN.=20
The<BR>&gt; &gt; &gt; =
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
INQUIRY is the only valid test allowed by the spec.<BR>&gt; &gt; &gt; =
<BR>&gt;=20
&gt; &gt; The draft of SCSI-2 spec I have here hints that INQUIRY should =
be=20
used<BR>&gt; &gt; &gt; to probe system configuration and that =
TEST_UNIT_READY is=20
more for<BR>&gt; &gt; &gt; polling on devices with removable =
media.<BR>&gt;=20
<BR>&gt; Why only removable ?<BR>&gt; It is intended to check if media =
can be=20
accessed, regardless the media<BR>&gt; type.<BR>&gt; <BR>&gt; &gt; &gt; =
I tossed=20
the TEST_UNIT_READY<BR>&gt; &gt; &gt; part out and INQUIRY alone works =
fine (one=20
disk, 2 CDs and a tape on<BR>&gt; &gt; &gt; a BusLogic clone - all found =
as per=20
usual).<BR>&gt; &gt; <BR>&gt; &gt; Looks good to me. Although I can't =
possibly=20
see what harm a TEST_UNIT_READY<BR>&gt; &gt; command could do...<BR>&gt; =

<BR>&gt; TEST UNIT READY seems not appropriate for the discovery of =
devices.=20
It<BR>&gt; also may return CHECK CONDITION when INQUIRY will succeed =
(and=20
preserve a<BR>&gt; UNIT ATTENTION CONDITION if any).<BR>&gt; <BR>&gt; On =
the=20
other hand, it may be risky to try a TUR on an not existing LUN,<BR>&gt; =
given=20
that SCSI devices usually expect INQUIRY. Broken SCSI device<BR>&gt; =
firmwares=20
may arm on a TUR to a non existing LUN but not harm on an<BR>&gt;=20
INQUIRY.<BR>&gt; <BR>&gt; INQUIRY will not fail is a device is here. If =
the=20
device is not ready,<BR>&gt; INQUIRY may well be the the only command =
the device=20
wants to accept.<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; The main problem =
with not using=20
TUR is that I believe that INQUIRY is not required to be sensitive to =
the LUN=20
number.&nbsp; In other words, an INQUIRY in order to detect whether a =
lun is=20
actually present at a given lun number, you also need to do a TUR.&nbsp; =

</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; I tried digging =
around in the=20
standards to find something which describes this situation.&nbsp; =
Section 7.5.3=20
(Selection of an invalid logical unit) seems to cover this a little=20
bit:</FONT></DIV>
<BLOCKQUOTE style=3D"MARGIN-RIGHT: 0px">
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>7.5.3 Selection of an invalid logical =

  unit</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><BR>The target&#8217;s response to =
selection of a=20
  logical unit that is not valid is described in the following=20
  paragraphs.<BR>The logical unit may not be valid because:</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><BR>a) the target does not support =
the logical=20
  unit (e.g. some targets support only one peripheral device). In =
response<BR>to=20
  an INQUIRY command, the target shall return the INQUIRY data with the=20
  peripheral qualifier set to the value<BR>required in 8.2.5.1. In =
response to=20
  any other command except REQUEST SENSE, the target shall =
terminate<BR>the=20
  command with CHECK CONDITION status. In response to a REQUEST SENSE =
command,=20
  the target shall<BR>return sense data. The sense key shall be set to =
ILLEGAL=20
  REQUEST and the additional sense code shall be<BR>set to LOGICAL UNIT =
NOT=20
  SUPPORTED.</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><BR>b) the target supports the =
logical unit, but=20
  the peripheral device is not currently attached to the target. In=20
  response<BR>to an INQUIRY command, the target shall return the INQUIRY =
data=20
  with the peripheral qualifier set to the value<BR>required in 8.2.5.1. =
In=20
  response to any other command except REQUEST SENSE, the target shall=20
  terminate<BR>the command with CHECK CONDITION status. In response to a =
REQUEST=20
  SENSE command, the target shall<BR>return sense data. The sense key =
shall be=20
  set to ILLEGAL REQUEST and the additional sense code shall be<BR>set =
to=20
  LOGICAL UNIT NOT SUPPORTED.</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><BR>c) the target supports the =
logical unit and=20
  the peripheral device is attached, but not operational. In response =
to<BR>an=20
  INQUIRY command, the target shall return the INQUIRY data with the =
peripheral=20
  qualifier set to the value<BR>required in 8.2.5.1. The target&#8217;s =
response to=20
  any command other than INQUIRY and REQUEST SENSE=20
  is<BR>vendor-specific.</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><BR>d) the target supports the =
logical unit but=20
  is incapable of determining if the peripheral device is attached or is =

  not<BR>operational when it is not ready. In response to an INQUIRY =
command,the=20
  target shall return the INQUIRY data<BR>with the peripheral qualifier =
set to=20
  the value required in 8.2.5.1. In response to a REQUEST SENSE =
command,<BR>the=20
  target shall return the REQUEST SENSE data with a sense key of NO =
SENSE unless=20
  a contingent<BR>allegiance exists. The target&#8217;s response to any =
other command=20
  is vendor-specific.</FONT></DIV></BLOCKQUOTE>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; Reversing the order =
of the=20
INQUIRY/TUR wouldn't hurt anything I guess.&nbsp; Eliminating it =
altogether=20
seems dangerous.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; In SCSI-3, there is =
now a=20
command that can be used to ask a device what logical units are=20
present.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>-Eric</FONT></DIV>
<DIV><BR><FONT face=3DArial =
size=3D2><BR></FONT>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_00B1_01BFCD83.8F484030--


-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.rutgers.edu

home help back first fref pref prev next nref lref last post