From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Lower USB_MAX_XFER_BLK to 32767 for trimslice
Date: Sat, 28 May 2016 14:02:47 +0200 [thread overview]
Message-ID: <574988E7.1030707@denx.de> (raw)
In-Reply-To: <1464422798-6930-1-git-send-email-kwizart@gmail.com>
On 05/28/2016 10:06 AM, Nicolas Chauvet wrote:
> 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=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:
This should go below diffstat, so it's not part of the commit message
> - Allow to override if undefined when using CONFIG_USB_EHCI
> - Only change the value for trimslice
This will annoy trimslice users then ;-)
> - 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.
> Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
> ---
> common/usb_storage.c | 2 ++
> include/configs/trimslice.h | 2 ++
> 2 files changed, 4 insertions(+)
>
> diff --git a/common/usb_storage.c b/common/usb_storage.c
> index 7e6e52d..aea0477 100644
> --- a/common/usb_storage.c
> +++ b/common/usb_storage.c
> @@ -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)
> #else
> #define USB_MAX_XFER_BLK 20
> #endif
> diff --git a/include/configs/trimslice.h b/include/configs/trimslice.h
> index b761640..3a2fe87 100644
> --- a/include/configs/trimslice.h
> +++ b/include/configs/trimslice.h
> @@ -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
>
--
Best regards,
Marek Vasut
prev parent reply other threads:[~2016-05-28 12:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-26 20:55 [U-Boot] [PATCH] Lower USB_MAX_XFER_BLK to 32767 by default for trimslice Nicolas Chauvet
2016-05-26 21:17 ` Marek Vasut
2016-05-28 8:06 ` [U-Boot] [PATCH] Lower USB_MAX_XFER_BLK to 32767 " Nicolas Chauvet
2016-05-28 12:02 ` Marek Vasut [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=574988E7.1030707@denx.de \
--to=marex@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox