public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* USB storage devices and SAT
@ 2008-08-04  1:10 Douglas Gilbert
  2008-08-04  1:33 ` James Bottomley
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Douglas Gilbert @ 2008-08-04  1:10 UTC (permalink / raw)
  To: linux-scsi@vger.kernel.org; +Cc: Alan Stern, USB Storage list

USB storage devices that support SAT (the T10 SCSI to ATA
translation standard) are beginning to appear.

SAT enables tools like smartmontools to access SMART data
on a ATA disk in a USB enclosure. We have run into
a problem. It seems that the usb storage subsystem is wedded
to the idea of sense data that is no longer than 18 bytes. **
That doesn't play well with SAT which uses descriptor format
sense data that is made up of an 8 byte header plus zero or
more descriptors. SAT uses a 14 byte "ATA return" (sense)
descriptor to yield the ATA registers. That means the sense
data length is 22 bytes when an ATA return descriptor is
required.

Alan Stern has already noted to another smartmontools developer
that such a change is likely to break some USB storage devices.
Perhaps the maximum sense buffer size could be optionally
specified per usb storage device. Alternatively the usb mass
storage logic could make some dynamic decisions itself.
For example if the (disk) device responds successfully to either
SCSI ATA PASS_THROUGH (12 or 16 byte) command then it will
be capable of (at least) 22 byte sense data. A T10 vendor
identification field in a standard INQUIRY response of
"ATA     " is another indication of a device that supports
SAT.


** the 18 byte sense data limit comes from SCSI-2 (circa 1992).
That was upped to 252 bytes around 10 years ago. Some SCSI disk
vendors have been using the extra bytes (above 18) for some
time. Then in SPC-3 (standard in 2005) descriptor format sense
data was introduced and SAT uses it. There are other uses: any
SCSI (virtual) disk that needs more than 32 bits to represent all
its LBAs should use descriptor format for MEDIUM ERRORs. The
reason is that MEDIUM ERRORs should include the LBA of the first
failure and the "info" field in the older "fixed" sense format
is only 4 bytes.

Doug Gilbert

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2008-09-08  7:28 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-04  1:10 USB storage devices and SAT Douglas Gilbert
2008-08-04  1:33 ` James Bottomley
2008-08-04  2:18   ` [usb-storage] " Matthew Dharm
2008-08-04  2:21 ` Matthew Dharm
2008-08-04  8:31   ` Boaz Harrosh
2008-08-04 15:21     ` Matthew Dharm
2008-08-04 15:51 ` Alan Stern
2008-08-04 17:45   ` [usb-storage] " Matthew Dharm
2008-08-05 11:54     ` Boaz Harrosh
2008-08-05 14:51       ` Alan Stern
2008-08-05 15:10         ` Boaz Harrosh
2008-08-05 15:34         ` Douglas Gilbert
2008-08-05 15:57           ` Boaz Harrosh
2008-08-05 16:09             ` Boaz Harrosh
2008-08-05 17:42             ` matthieu castet
2008-09-07 19:35       ` matthieu castet
2008-09-08  7:27         ` Boaz Harrosh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox