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

Alan Stern
2010-04-21T14:53:06Z

On Wed, 21 Apr 2010, James Bottomley wrote:

> > That said.. what would you recommend as a way for a userspace
> > program to figure out whether to use ATA_12 or ATA_16 to talk
> > to a given arbitrary device name ?
>
> To be honest, no. For USB, All USB is SCSI or RBC command based. You
> don't have any idea whether it's a real SCSI device or an ATA device
> behind a SAT ... the only reason you assume it's ATA is because USB
> gadget builders tend to be cheapskates.
>
> > I guess the info is in sysfs somewhere.
>
> Only for direct interconnects. For USB most bets are off.

You can find out whether the device might be MMC by sending an ordinary
SCSI INQUIRY command. (Or you can get the device type from the
"modalias" attribute file in the device's sysfs directory, which just
shows the information the kernel got when _it_ sent an INQUIRY
command.) If it might be MMC, _don't_ try to use ATA_12!

The interpretation of the commands sent from hdparm is done by the
device's bridge chip. In theory these chips can apply different
translations depending on whether the attached drive is ATA or ATAPI.
I don't know if any existing bridge chips behave this way, though --
and either way, I don't know how a program can figure out what type the
drive is. Especially since the bridge chip isn't obliged to understand
SAT in the first place.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html