Re: System hangs when using USB 3.0 HD with on Ubuntu

Alan Stern
2010-05-12T15:09:46Z

On Wed, 12 May 2010, Mark Lord wrote:

> The sticky part is that hdparm explicitly asked for sense data.
>
> But the results were marked as "no sense data". Many of the commands
> sent by hdparm _require_ "sense data" (ATA register values) in order
> to see the results. The USB driver appears to ignore that request
> when it sees good device status from the original command. Bug.

This sounds like it is a bug in the SCSI midlayer, not in usb-storage.

There is no mechanism for the midlayer to tell low-level drivers like
usb-storage that sense data must be returned. The documentation in
include/scsi/scsi_cmnd.h merely states that the sense buffer should be
filled when CHECK CONDITION is received for the original command.
Ditto for Documentation/scsi/scsi_mid_low_api.txt. Hence if sense data
is needed even in the absence of CHECK CONDITION, the midlayer must
explicitly send a command to retrieve it.

What mechanism does hdparm use to submit its I/O requests, and how does
it indicate that it requires sense data?

Alan Stern