public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Cohen <david.a.cohen@linux.intel.com>
To: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	Julius Werner <jwerner@chromium.org>,
	Dan Williams <dan.j.williams@intel.com>,
	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>,
	Ksenia Ragiadakou <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: Fri, 13 Dec 2013 10:00:28 -0800	[thread overview]
Message-ID: <20131213180028.GA7863@psi-dev26.jf.intel.com> (raw)
In-Reply-To: <20131213174815.GA10727@xanatos>

Hi Sarah,

On Fri, Dec 13, 2013 at 09:48:15AM -0800, Sarah Sharp wrote:
> On Thu, Dec 12, 2013 at 11:05:04AM -0500, Alan Stern wrote:
> > On Wed, 11 Dec 2013, Julius Werner wrote:
> > 
> > > >> ...although, the spec says that it does not wait for the port resets
> > > >> to complete.  As far as I can see re-issuing a warm reset and waiting
> > > >> is the only way to guarantee the core times the recovery.  Presumably
> > > >> the portstatus debounce in hub_activate() mitigates this, but that
> > > >> 100ms is less than a full reset timeout.
> > > 
> > > It's definitely not just a timing issue for us. I can't reproduce all
> > > the same cases as Vikas, but when I attach a USB analyzer to the ones
> > > I do see the host controller doesn't even start sending a reset.
> > > 
> > > >>> 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?
> > > 
> > > Oh, interesting, I hadn't seen that yet. So I guess the spec itself is
> > > fine if it were followed to the letter.
> > > 
> > > I did some more tests about this on my Exynos machine: when I put a
> > > device to autosuspend (U3) and manually poke the xHC reset bit, I do
> > > see an automatic warm reset on the analyzer and the ports manage to
> > > retrain to U0. But after a system suspend/resume which calls
> > > xhci_reset() in the process, there is no reset on the wire. I also
> > > noticed that it doesn't drive a reset (even after manual poking) when
> > > there is no device connected on the other end of the analyzer.
> > > 
> > > So this might be our problem: maybe these host controllers (Synopsys
> > > DesignWare) issue the spec-mandated warm reset only on ports where
> > > they think there is a device attached. But after a system
> > > suspend/resume (where the whole IP block on the SoC was powered down),
> > > the host controller cannot know that there is still a device with an
> > > active power session attached, and therefore doesn't drive the reset
> > > on its own.
> 
> Ok, that makes some sense.  I could see why host controllers wouldn't
> want to drive reset on an unconnected port.
> 
> > > Even though this is a host controller bug, we still have to deal with
> > > it somehow. I guess we could move the code into xhci_plat_resume() and
> > > hide it behind a quirk to lessen the impact. But since reset_resume is
> > > not a common case for most host controllers, it's hard to say if this
> > > is DesignWare specific or a more widespread implementation mistake.
> > 
> > I was going to suggest something along these lines too.  This seems to 
> > be a bug in xHCI.  Therefore the fix belongs in xhci-hcd, not in the 
> > hub driver.
> 
> I agree.  Is there a chance that the Synopsys DesignWare will be a PCI
> device instead of a platform device?  If so, it would be better to put
> the code into xhci_resume instead of xhci_plat_resume.  That also allows

DWC3 on Intel Baytrail and Merrifield is PCI device.

Br, David


  parent reply	other threads:[~2013-12-13 17:55 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
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 [this message]
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=20131213180028.GA7863@psi-dev26.jf.intel.com \
    --to=david.a.cohen@linux.intel.com \
    --cc=balbi@ti.com \
    --cc=burzalodowa@gmail.com \
    --cc=dan.j.williams@intel.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=sarah.a.sharp@linux.intel.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