Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Mar 2000 20:32:18 -0700
From:      "Kenneth D. Merry" <ken@kdm.org>
To:        Nick Hibma <n_hibma@calcaphon.com>
Cc:        Mike Smith <msmith@FreeBSD.ORG>, mjacob@feral.com, FreeBSD SCSI Mailing List <scsi@FreeBSD.ORG>
Subject:   Re: first INQUIRY goes round in circles (fwd)
Message-ID:  <20000306203217.A80256@panzer.kdm.org>
In-Reply-To: <Pine.BSF.4.20.0003070136490.310-100000@localhost>; from n_hibma@calcaphon.com on Tue, Mar 07, 2000 at 01:42:02AM %2B0000
References:  <20000306143551.A78310@panzer.kdm.org> <Pine.BSF.4.20.0003070136490.310-100000@localhost>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Mar 07, 2000 at 01:42:02 +0000, Nick Hibma wrote:
> After having another look at what CAM does, the following strikes me as
> odd. In the case of SF_RETRY_UA being set, the command is retried
> _without_ decrementing the retry_count. Can anyone enlighten me as to
> why that is being done this way?
> 
> It's the cause of the infinite retry of the initial INQUIRY command.

A unit attenion is not supposed to be returned in response to an inquiry.
But your drive is returning a unit attention error.  Here's the relevant
section from the SCSI-2 spec:

========================================================================
The INQUIRY command shall return CHECK CONDITION status only when the
target cannot return the requested INQUIRY data. 

     NOTE 64 The INQUIRY data should be returned even though the peripheral
	     device may not be ready for other commands. 

If an INQUIRY command is received from an initiator with a pending unit
attention condition (i.e. before the target reports CHECK CONDITION
status), the target shall perform the INQUIRY command and shall not
clear the unit attention condition (see 7.9). 
========================================================================

So there are two components:

 - the target should *only* return an error if it cannot return the
   inquiry data.

 - any unit attention condition should not be cleared by an inquiry [*]

But any other command should generate the check condition which would then
clear the unit attention state.

So in most cases, a unit attention will be cleared after the first command,
so the "infinite" number of retries only ends up being 1.

You're running into this problem because you've got a broken driver that
reports an error in response to an inquiry.

[*]  Unit attention handling is actually a little more complicated than I've
described, due to contingent allegiance conditions.  Don't ask me to
explain that, since I don't have a good understanding of it. :)  It's
explained in the SCSI specs.

> (This does not solve the problem of UA not being reset for my drive,
> but that needs a quirk anyway, instead of modifying the asc_text quirk
> table)

You can't have a quirk entry for a device that doesn't have inquiry data
yet, since quirk entries are matched against inquiry data.  The only way
to quirk it would be to have a system specific bus/target/lun quirked.

Ken
-- 
Kenneth Merry
ken@kdm.org


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-scsi" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000306203217.A80256>