On Sat, 27 May 2000, Jens Axboe wrote:
> On Sat, May 27 2000, Paul Gortmaker wrote:
> > > To Do
> > > -----
> > > Linux sends a 1K buffer with SCSI inquiries. The ANSI-SCSI limit is 255.
> >
> > I don't see how this can be. In scan_scsis() scsi_result0[256] is
> > declared, and if that isn't appropriate for host needing DMA then
> > we kmalloc(512, GFP_DMA) - either way it doesn't matter since the
> > allocation length field in the CCB for INQUIRY is only a byte (and
> > we set it to 255). Even scsi_wait_req() is told the the result buffer
> > length is 255 when the INQUIRY command is lodged.
>
> Exactly, I told Alan this several weeks ago also.
>
> > > 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 only vertue of TEST UNIT READY is that it returns no data and so does
not need sync parameters to be in sync between target and initiator. I
donnot see situations when this can be useful, excepted if both WIDE+SYNC
negotiation is not performed on a single command and BUS is not reset
prior to the scan.
In my opinion, there is no reason for performing a TUR prior to the
INQUIRY for the BUS scan. But a TUR may be performed prior to accessing
the media, for example to read the capacity or partition table of a hard
disk.
Gérard.
-
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 May 31 2000 - 21:00:18 EST