From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Roger Quadros <rogerq@ti.com>, mathias.nyman@intel.com
Cc: balbi@ti.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/5] usb: xhci: Fix breakage on dual-role case
Date: Thu, 27 Aug 2015 14:18:13 +0300 [thread overview]
Message-ID: <55DEF1F5.6010907@linux.intel.com> (raw)
In-Reply-To: <55D57D29.1040702@ti.com>
On 20.08.2015 10:09, Roger Quadros wrote:
> Hi Mathias,
Hi
>
> On 18/08/15 13:39, Roger Quadros wrote:
>> Hi,
>>
>> Plugging and unplugging a USB-OTG adapter with a USB device into a
>> am437x-gp-evm dual-role port (USB1) causes XHCI to malfunction
>> and USB device to be no longer detected after a few iterations.
>>
>> The triggering case is so
>> 1) USB1 in peripheal mode
>> 2) plug OTG adapter with USB device
>> 3) USB1 switches to host mode
>> 4) Detects new USB device
>> 5) unplug OTG adapter
>> 6) OTG core tries to remove host controller while new device
>> is being processed.
>>
>> At 6 some races are observed in the XHCI driver causing it to
>> malfunction. See kernel log at the end of this mail.
>>
>> This series tries to address some of the issues.
>> Althouth it is not 100% fool proof yet and XHCI can still get
>> stuck up for a few seconds occasionally, it did recover always
>> in a max of 10 seconds and the USB device was enumerated after
>> that.
>>
>> During a dual-role switch, usb_remove_hcd() and usb_add_hcd()
>> will be called consecutively for both Shared and Primary
>> HCDs. This can happen asynchronously and we have to be prepared
>> for it.
>>
>
> Even after this series I do occasionally see a delay of 5 seconds
> during adapter detach. (please see kernel log below).
>
> Is it possible to further optimize so that when xhci_stop is called
> we don't depend entirely on timeout timers to stop queued commands?
Yes, sounds reasonable. Command timer and ring could probably be stopped,
remaining commands aborted and returned.
-Mathias
prev parent reply other threads:[~2015-08-27 11:14 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-18 10:39 [PATCH 0/5] usb: xhci: Fix breakage on dual-role case Roger Quadros
2015-08-18 10:39 ` [PATCH 1/5] usb: xhci: lock mutex on xhci_stop Roger Quadros
2015-08-18 11:39 ` Mathias Nyman
2015-08-18 10:39 ` [PATCH 2/5] usb: hcd: Initialize hcd->flags to 0 Roger Quadros
2015-08-18 10:39 ` [PATCH 3/5] usb: xhci: Clear XHCI_STATE_DYING on start Roger Quadros
2015-08-18 11:43 ` Mathias Nyman
2015-08-18 10:39 ` [PATCH 4/5] usb: xhci: stop everything on the first call to xhci_stop Roger Quadros
2015-08-18 12:14 ` Mathias Nyman
2015-08-20 6:42 ` Roger Quadros
2015-08-18 10:39 ` [PATCH 5/5] usb: xhci: exit early in xhci_setup_device() if we're halted or dying Roger Quadros
2015-08-18 12:17 ` Mathias Nyman
2015-08-20 7:09 ` [PATCH 0/5] usb: xhci: Fix breakage on dual-role case Roger Quadros
2015-08-27 11:18 ` Mathias Nyman [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=55DEF1F5.6010907@linux.intel.com \
--to=mathias.nyman@linux.intel.com \
--cc=balbi@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.com \
--cc=rogerq@ti.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.