From: Sarah Sharp <sarah.a.sharp@linux.intel.com>
To: Julius Werner <jwerner@chromium.org>
Cc: Alan Stern <stern@rowland.harvard.edu>,
Vikas Sajjan <sajjan.linux@gmail.com>,
Vikas Sajjan <vikas.sajjan@linaro.org>,
linux-samsung-soc <linux-samsung-soc@vger.kernel.org>,
Kukjin Kim <kgene.kim@samsung.com>,
LKML <linux-kernel@vger.kernel.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
Vincent Palatin <vpalatin@chromium.org>,
Lan Tianyu <tianyu.lan@intel.com>,
burzalodowa@gmail.com,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Vivek Gautam <gautam.vivek@samsung.com>,
Douglas Anderson <dianders@chromium.org>,
Felipe Balbi <balbi@ti.com>, sunil joshi <joshi@samsung.com>
Subject: Re: [PATCH] USB: core: Add warm reset while reset-resuming SuperSpeed HUBs
Date: Wed, 11 Dec 2013 11:36:47 -0800 [thread overview]
Message-ID: <20131211193647.GA25483@xanatos> (raw)
In-Reply-To: <CAODwPW_ZUgHWymOF7Fzxh7sbhrvV0-g-pMXWQm=eSz2U8EBRtQ@mail.gmail.com>
On Wed, Dec 11, 2013 at 11:00:13AM -0800, Julius Werner wrote:
> > I don't know what you mean by "fails". The system goes to sleep and
> > then later on wakes up, doesn't it?
> >
> > Do you mean that the Jetflash device gets disconnected when the system
> > wakes up? That's _supposed_ to happen under those circumstances.
> > When hub_activate() sees HUB_RESET_RESUME, all child devices get
> > disconnected except those where udev->persist_enabled is set.
>
> This patch was written in response to the same bug as my "usb: hub:
> Use correct reset for wedged USB3 devices that are NOTATTACHED"
> submission. My patch only helps when the port gets stuck in Compliance
> Mode, but Vikas reports that he can sometimes see it stuck in Polling
> or Recovery states as well.
>
> The underlying issue is a deadlock in the USB 3.0 link training state
> machine when the host controller is unilaterally reset on resume
> (without driving a reset on the bus).
The xHCI spec requires that when the xHCI host is reset, a USB reset is
driven down the USB 3.0 ports. If hot reset fails, the port may migrate
to warm reset. See table 32 in the xHCI spec, in the definition of
HCRST. It sounds like this host doesn't drive a USB reset down USB 3.0
ports at all on host controller reset?
> The host port starts out back in
> Rx.Detect without remembering anything about its previous state, but
> the device is still in U3. The host detects Rx terminations, moves to
> Polling and starts sending LFPS link training packets, but the device
> doesn't expect those and interprets them as link problems (moving to
> Recovery). What happens next seems to be device specific, but
> apparently the device can end up in SS.Inactive while the host port
> gets stuck in Polling or Recovery (or some kind of livelock between
> those).
>
> This patch tries to warm reset all USB 3.0 ports on reset-resume
> (after xhci_reset() was called) that had devices connected to them
> before suspend. This seems to be the only way to ensure the devices'
> state machines get back to a well-defined state that the host can work
> with. I don't think this is a specific hardware bug, it's just an
> unfortunate design flaw that the USB 3.0 spec doesn't account for a
> root hub port being reset independently of its connected device. I
> think Sarah is correct that it could be limited to root hubs, though.
Sarah Sharp
next prev parent reply other threads:[~2013-12-11 19:36 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-09 12:29 [PATCH] USB: core: Add warm reset while reset-resuming SuperSpeed HUBs Vikas Sajjan
2013-12-09 12:51 ` Vivek Gautam
2013-12-09 15:24 ` Alan Stern
2013-12-09 18:24 ` Sarah Sharp
2013-12-10 5:23 ` Vikas Sajjan
2013-12-10 5:30 ` Vikas Sajjan
2013-12-11 17:18 ` Alan Stern
2013-12-11 19:00 ` Julius Werner
2013-12-11 19:36 ` Sarah Sharp [this message]
2013-12-11 22:51 ` Dan Williams
2013-12-11 23:38 ` Dan Williams
2013-12-12 7:01 ` Julius Werner
2013-12-12 16:05 ` Alan Stern
2013-12-13 17:48 ` Sarah Sharp
2013-12-13 17:57 ` Dan Williams
2013-12-13 18:15 ` Alan Stern
2013-12-13 18:27 ` Dan Williams
2013-12-13 18:00 ` David Cohen
2013-12-13 18:34 ` David Cohen
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=20131211193647.GA25483@xanatos \
--to=sarah.a.sharp@linux.intel.com \
--cc=balbi@ti.com \
--cc=burzalodowa@gmail.com \
--cc=dianders@chromium.org \
--cc=gautam.vivek@samsung.com \
--cc=gregkh@linuxfoundation.org \
--cc=joshi@samsung.com \
--cc=jwerner@chromium.org \
--cc=kgene.kim@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=sajjan.linux@gmail.com \
--cc=stern@rowland.harvard.edu \
--cc=tianyu.lan@intel.com \
--cc=vikas.sajjan@linaro.org \
--cc=vpalatin@chromium.org \
/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