Lower USB_MAX_XFER_BLK to 32767 by default for trimslice
PATCH 1/1 Lower USB_MAX_XFER_BLK to 32767 by default for trimslice
I'm experiencing an issue when loading a generic distro initramfs on trimslice-pro (with ssd using ehci) with the default value of 65535 for USB_MAX_XFER_BLK
EHCI timed out on TD - token=0x80008d80
As adviced by Marek on IRC, using a lower value for USB_MAX_XFER_BLK allows to load the file
Tested values on tegra20-trimslice:
4095 ok
32767 ok
32768 timeout
36864 timeout
40960 timeout
49150 timeout
Tested on current u-boot master
--- common/usb_storage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
common/usb_storage.c +1 -1
@@ -106,7 +106,7 @@ struct us_data {* enough free heap space left, but the SCSI READ(10) and WRITE(10) commands are * limited to 65535 blocks. */ -#define USB_MAX_XFER_BLK 65535 +#define USB_MAX_XFER_BLK 32767#else #define USB_MAX_XFER_BLK 20#endif
Signature · 1 line
2.4.11
PATCH 1/1 Lower USB_MAX_XFER_BLK to 32767 by default for trimslice
Quoted 16 lines · Nicolas Chauvet
I'm experiencing an issue when loading a generic distro initramfs on trimslice-pro (with ssd using ehci) with the default value of 65535 for
USB_MAX_XFER_BLK
EHCI timed out on TD - token=0x80008d80As adviced by Marek on IRC, using a lower value for
USB_MAX_XFER_BLKallows to load the fileTested values on tegra20-trimslice:
4095 ok
32767 ok
32768 timeout
36864 timeout
40960 timeout
49150 timeout
Quoted 1 line
Tested on current u-boot master
I don't really like adding such patch which affects many devices just to fix one particular device which is crappy. If you could add some quirk table into u-boot instead and lower this number only for those buggy devices, that'd be much better.
Quoted 19 lines
Signed-off-by Nicolas Chauvet <[email protected]>--- common/usb_storage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)common/usb_storage.c +1
-1@@ -106,7 +106,7 @@ struct us_data {* enough free heap space left, but the SCSI READ(10) and WRITE(10) commands are * limited to 65535 blocks. */ -#define USB_MAX_XFER_BLK 65535 +#define USB_MAX_XFER_BLK 32767#else #define USB_MAX_XFER_BLK 20#endif
Signature · 2 lines
Best regards, Marek Vasut
PATCH 1/1 Lower USB_MAX_XFER_BLK to 32767 for trimslice
In reply to Nicolas ChauvetI'm experiencing an issue when loading a generic distro initramfs on trimslice-pro (with ssd using usb-ehci) with the default value of 65535 for USB_MAX_XFER_BLK
EHCI timed out on TD - token=0x80008d80
As adviced by Marek on IRC, using a lower value for USB_MAX_XFER_BLK allows to load the file
Tested values on tegra20-trimslice:
4095 ok
32767 ok
32768 timeout
36864 timeout
40960 timeout
49150 timeout
v2:
- Allow to override if undefined when using CONFIG_USB_EHCI
- Only change the value for trimslice
- Update description
--- common/usb_storage.c | 2 ++ include/configs/trimslice.h | 2 ++ 2 files changed, 4 insertions(+)
common/usb_storage.c +2 -0
@@ -106,7 +106,9 @@ struct us_data {* enough free heap space left, but the SCSI READ(10) and WRITE(10) commands are * limited to 65535 blocks. */ +#ifndef USB_MAX_XFER_BLK /* Allows a quirk for broken devices */ #define USB_MAX_XFER_BLK 65535 +#endif #else #define USB_MAX_XFER_BLK 20#endif
include/configs/trimslice.h +2 -0
@@ -43,6 +43,8 @@#define CONFIG_USB_EHCI #define CONFIG_USB_EHCI_TEGRA #define CONFIG_USB_STORAGE +/* Quirk for broken usb-ehci on trimslice */ +#define USB_MAX_XFER_BLK 32767/* USB networking support */ #define CONFIG_USB_HOST_ETHER
Signature · 1 line
2.4.11
PATCH 1/1 Lower USB_MAX_XFER_BLK to 32767 for trimslice
Quoted 16 lines · Nicolas Chauvet
I'm experiencing an issue when loading a generic distro initramfs on trimslice-pro (with ssd using usb-ehci) with the default value of 65535 for
USB_MAX_XFER_BLK
EHCI timed out on TD - token=0x80008d80As adviced by Marek on IRC, using a lower value for
USB_MAX_XFER_BLKallows to load the fileTested values on tegra20-trimslice:
4095 ok
32767 ok
32768 timeout
36864 timeout
40960 timeout
49150 timeout
Quoted 1 line
v2:
This should go below diffstat, so it's not part of the commit message
Quoted 2 lines
- Allow to override if undefined when using
CONFIG_USB_EHCI
- Only change the value for trimslice
This will annoy trimslice users then ;-)
Quoted 1 line
- Update description
Going back to my comment about V1:
If you could add some quirk table into u-boot instead and lower this number only for those buggy devices, that'd be much better.
Quoted 11 lines
Signed-off-by Nicolas Chauvet <[email protected]>--- common/usb_storage.c | 2 ++ include/configs/trimslice.h | 2 ++ 2 files changed, 4 insertions(+)common/usb_storage.c +0
-0
common/usb_storage.c struct us_data { · line 111
Quoted 6 lines
common/usb_storage.c +2
-0@@ -106,7 +106,9 @@ struct us_data {* enough free heap space left, but the SCSI READ(10) and WRITE(10) commands are * limited to 65535 blocks. */ +#ifndef USB_MAX_XFER_BLK /* Allows a quirk for broken devices */ #define USB_MAX_XFER_BLK 65535 +#endif
This has multiple problems:
a) This override is added only for EHCI while it is generic and would work for all USB revisions
b) Any such override should be added to Kconfig instead
c) Tweaking this value will negatively impact multiple devices only to fix problems on a small amount of crappy devices (see above)
Quoted 17 lines
common/usb_storage.c +0
-0#else #define USB_MAX_XFER_BLK 20#endif include/configs/trimslice.h +2
-0@@ -43,6 +43,8 @@#define CONFIG_USB_EHCI #define CONFIG_USB_EHCI_TEGRA #define CONFIG_USB_STORAGE +/* Quirk for broken usb-ehci on trimslice */ +#define USB_MAX_XFER_BLK 32767/* USB networking support */ #define CONFIG_USB_HOST_ETHER
Signature · 2 lines
Best regards, Marek Vasut