public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/1] tegra: usb: Fix device enumeration problem of USB1
Date: Fri, 15 Jun 2012 10:47:11 -0600	[thread overview]
Message-ID: <4FDB670F.703@wwwdotorg.org> (raw)
In-Reply-To: <4B9C9637D5087840A465BDCB251780E9E2D629AF72@HKMAIL02.nvidia.com>

On 06/15/2012 03:38 AM, Jim Lin wrote:
> On 06/14/2012 04:40 AM, Jim Lin wrote:
>>> For some reason, bit 1 (connect status change) of PORTSC will be set
>>> after issuing Port Reset (like "usb reset" in u-boot command line).
>>> This will be treated as an error and stops later device enumeration.
>>>
>>> Therefore we add a definition in header file to ignore checking of that bit
>>> after Port Reset.
>>> CONFIG_USB_RESET_IGNORE_CONNECT_CHANGE
> 
>> (Again, I'm CC'ing the USB maintainer here)
> 
>> Looking at the Linux kernel's Tegra EHCI driver:
>> a) This WAR is only needed on the first USB port, not all of them.
> 
>   [Jim] No penalty for USB2 and USB3 ports. Because u-boot hub_port_reset
>   has at most 5 times of retry for a port.
>   USB2 and USB3 ports will reset once in retry loop
>   ('port connect change' bit will not set after reset).
>   USB1 will have at most 2 times of reset in the retry loop after adding
>   this patch.

Yes, there is no time penalty, but presumably there's a reason that
hub_port_reset() explicitly checks whether PORT_STAT_C_CONNECTION is set
and fails if it is. This change will remove that check for USB2 and USB3
and thus change the behavior of those ports which are not affected by
the bug this patch is trying to fix.

>> b) This WAR is not complete; there's a loop in the kernel that resets
>> the port twice in order to guarantee that the port will become enabled.
> 
>   [Jim] Disagree. Because u-boot hub_port_reset has at most 5 times of retry
>   for a port. U-boot and kernel code are not entirely same.

OK, I see the loop. It's not doing exactly what the kernel is to the HW,
but it's hopefully close enough.

>> So, rather than just ifdef'ing this fix into the driver, wouldn't it be
>> better to add a callback from the USB core into the USB driver, so that
>> the Tegra EHCI driver could choose to only implement this WAR for port
>> 1, and also do the multiple-reset-loop thing.
> 
>   [Jim] No callback for me to cut in. Also no penalty for other ports.

My point was that a callback (or perhaps some kind of per-port flag if
not an actual callback) could be added, not that there was one already
that should be used.

>> Finally, in the change description, the text "for some reason" is quite
>> unclear; it sounds like you have absolutely no idea why this happens. Is
>> this a known and root-caused HW bug for which this fix has been fully
>> validated? Or, is this patch just some random hack that seems to work
>> for you?
> 
>   [Jim] This is a known and root-caused HW bug.

That's good to know. It'd be great if the commit description could be
more assertive on this point.

      reply	other threads:[~2012-06-15 16:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4B9C9637D5087840A465BDCB251780E9E2D629AF70@HKMAIL02.nvidia.com>
2012-06-14 10:40 ` [U-Boot] [PATCH 1/1] tegra: usb: Fix device enumeration problem of USB1 Jim Lin
2012-06-14 18:09   ` Stephen Warren
2012-06-15  9:38     ` Jim Lin
2012-06-15 16:47       ` Stephen Warren [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=4FDB670F.703@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --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