Re: dealing with enclosures that don't handle READ_CAPACITY10

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 12 Aug 2013, Oliver Neukum wrote:

> Hi,
> 
> I got a bug report about an enclosure that mishandles READ_CAPACITY10.
> I don't want to introduce yet another quirk. So what about basing this
> on USB version?

> @@ -211,8 +212,12 @@ static int slave_configure(struct scsi_device *sdev)
>                 /*
>                  * Many devices do not respond properly to READ_CAPACITY_16.
>                  * Tell the SCSI layer to try READ_CAPACITY_10 first.
> +                * However some USB 3.0 drive enclosures return capacity
> +                * modulo 2TB
>                  */
> -               sdev->try_rc_10_first = 1;
> +               usb_version = le16_to_cpu(us->pusb_dev->descriptor.bcdUSB);
> +               if (usb_version < '3' * 0x100)

Don't you mean 0x300?  '3' * 0x100 is really equal to 0x3300.

> +                       sdev->try_rc_10_first = 1;

This may be a reasonable thing to do, although there's always a risk 
that it will cause a regression.  I have definitely seen one or two 
reports about drives doing this, but I don't remember whether they 
claimed to be USB-2 or USB-3.

Alan Stern

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




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux