Commit df0052575b2bc9d66ae73584768e1a457ed5d914

Authored by Peng Fan
1 parent b4bc642c62

MLK-12883 usb: limit USB_MAX_XFER_BLK to 256

For Some USB mass storage devices, such as:
"
 - Kingston DataTraveler 2.0 001D7D06CF09B04199C7B3EA
 - Class: (from Interface) Mass Storage
 - PacketSize: 64  Configurations: 1
 - Vendor: 0x0930  Product 0x6545 Version 1.16
"
When `usb read 0x80000000 0 0x2000`, we met
"EHCI timed out on TD - token=0x80008d80".

The devices does not support scsi VPD page, we are not able
to get the maximum transfer length for READ(10)/WRITE(10).

So we limit this to 256 blocks as READ(6).

Signed-off-by: Peng Fan <peng.fan@nxp.com>

Showing 1 changed file with 3 additions and 1 deletions Side-by-side Diff

common/usb_storage.c
... ... @@ -18,6 +18,8 @@
18 18 * BBB support based on /sys/dev/usb/umass.c from
19 19 * FreeBSD.
20 20 *
  21 + * Copyright (C) 2016 Freescale Semiconductor, Inc.
  22 + *
21 23 * SPDX-License-Identifier: GPL-2.0+
22 24 */
23 25  
... ... @@ -103,7 +105,7 @@
103 105 * enough free heap space left, but the SCSI READ(10) and WRITE(10) commands are
104 106 * limited to 65535 blocks.
105 107 */
106   -#define USB_MAX_XFER_BLK 65535
  108 +#define USB_MAX_XFER_BLK 256
107 109 #else
108 110 #define USB_MAX_XFER_BLK 20
109 111 #endif