U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [PATCH] usb: ehci: Fix "EHCI timed out on TD - token=XXXX" error on ehci-hcd
Date: Fri, 28 Feb 2020 22:20:22 -0500	[thread overview]
Message-ID: <20200229032022.GN18302@bill-the-cat> (raw)
In-Reply-To: <accee9c1-d9c4-5a16-f782-606be138a817@denx.de>

On Sat, Feb 29, 2020 at 12:32:57AM +0100, Marek Vasut wrote:
> On 2/26/20 12:29 PM, Lukasz Majewski wrote:
> > This patch aims to improve robustness of 'usb' command operation on the
> > ehci-hcd IP block as it ports to contemporary U-Boot the patch described
> > and provided in [1] (originally applicable to U-Boot 2016.05).
> > 
> > According to the fix author - "rayvt" (from [1]):
> 
> [...]
> 
> > diff --git a/common/usb_storage.c b/common/usb_storage.c
> > index 097b6729c1..48c8c2ae64 100644
> > --- a/common/usb_storage.c
> > +++ b/common/usb_storage.c
> > @@ -111,6 +111,18 @@ int usb_stor_get_info(struct usb_device *dev, struct us_data *us,
> >  		      struct blk_desc *dev_desc);
> >  int usb_storage_probe(struct usb_device *dev, unsigned int ifnum,
> >  		      struct us_data *ss);
> > +
> > +#ifdef CONFIG_USB_EHCI_HCD
> > +	/*
> > +	 * The U-Boot EHCI driver can handle any transfer length as long as
> > +	 * there is enough free heap space left, but the SCSI READ(10) and
> > +	 * WRITE(10) commands are limited to 65535 blocks.
> > +	 */
> > +int usb_max_xfer_blk = 4096;
> > +#else
> > +int usb_max_xfer_blk = 20;
> > +#endif
> 
> This all looks horribly wrong and exactly what
> 7d6fd7f0ba71cd93d94079132f958d9630f27a89 and
> 02b0e1a36c5bc20174299312556ec4e266872bd6 fixed properly.
> 
> All those "dynamic reduction of transfer size" attempts are nonsensical,
> the real solution (sadly) is to reduce the transfer size to cater for
> the most limited devices and profile/fix the remaining delays in the USB
> stack (which should have already been done, see the commits above). This
> is also what the Linux USB stack does.
> 
> What is the problem you are trying to solve here ?

Things like the following (omap3_beagle_defconfig):
U-Boot SPL 2020.04-rc3-00009-g9e1d65f36b83 (Feb 28 2020 - 19:08:53 -0500)
Trying to boot from MMC1


U-Boot 2020.04-rc3-00009-g9e1d65f36b83 (Feb 28 2020 - 19:08:53 -0500)

OMAP3630/3730-GP ES1.1, CPU-OPP2, L3-200MHz, Max CPU Clock 800 MHz
Model: TI OMAP3 BeagleBoard
OMAP3 Beagle board + LPDDR/NAND
I2C:   ready
DRAM:  256 MiB
NAND:  0 MiB
MMC:   OMAP SD/MMC: 0
Loading Environment from NAND... *** Warning - readenv() failed, using default environment

Beagle xM Rev A/B
No EEPROM on expansion board
OMAP die ID: 6e5e00211ff00000015739eb08031024
Net:   usb_ether
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008c80
EHCI timed out on TD - token=0x80008c80
EHCI timed out on TD - token=0x80008c80
 ERROR: NOT USB_CONFIG_DESC b8
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008c80
EHCI timed out on TD - token=0x80008c80
EHCI timed out on TD - token=0x80008c80
EHCI timed out on TD - token=0x80008c80
EHCI timed out on TD - token=0x80008c80
EHCI timed out on TD - token=0x80008c80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008c80
EHCI timed out on TD - token=0x80008c80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008c80
EHCI timed out on TD - token=0x80008c80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008c80
EHCI timed out on TD - token=0x80008c80
EHCI timed out on TD - token=0x80008d80
3 USB Device(s) found
       scanning usb for ethernet devices... 0 Ethernet Device(s) found
Hit any key to stop autoboot:  2 \b\b\b 0 
BeagleBoard # usb tree
USB device tree:
  1  Hub (480 Mb/s, 0mA)
  |  u-boot EHCI Host Controller 
  |
  |\b+-2  Hub (480 Mb/s, 2mA)
    |
    |\b+-3  See Interface (480 Mb/s, 0mA)
         \b???\b???????? \b???\b???????? \b???\b????????
       
BeagleBoard # 

Note that the hub and ethernet are on-SBC and not something I'm plugging
in.  Thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200228/b83270d8/attachment.sig>

  reply	other threads:[~2020-02-29  3:20 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-26 11:29 [PATCH] usb: ehci: Fix "EHCI timed out on TD - token=XXXX" error on ehci-hcd Lukasz Majewski
2020-02-26 16:05 ` Tom Rini
2020-02-28 23:32 ` Marek Vasut
2020-02-29  3:20   ` Tom Rini [this message]
2020-02-29  7:20     ` Marek Vasut
2020-03-01 23:04       ` Tom Rini
2020-03-02  0:39         ` Marek Vasut
2020-03-02 17:00           ` Tom Rini
2020-03-14 18:16             ` Marek Vasut
2020-03-01 17:19   ` Lukasz Majewski
2020-03-01 17:35     ` Marek Vasut
2020-03-01 17:59       ` Lukasz Majewski
2020-03-01 18:39         ` Marek Vasut
2020-03-02 13:01           ` Lukasz Majewski
2020-03-02 19:08             ` Marek Vasut
2020-03-02 13:21 ` Lukasz Majewski
2020-03-02 19:19   ` Marek Vasut
2020-03-02 19:54     ` Tom Rini
2020-03-02 19:58       ` Marek Vasut
2020-03-02 19:59         ` Tom Rini
2020-03-02 23:25     ` Lukasz Majewski
2020-03-03 12:29       ` Marek Vasut

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=20200229032022.GN18302@bill-the-cat \
    --to=trini@konsulko.com \
    --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