public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Cohen <david.a.cohen@linux.intel.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: "Tang, Jianqiang" <jianqiang.tang@intel.com>,
	"stern@rowland.harvard.edu" <stern@rowland.harvard.edu>,
	"sarah.a.sharp@linux.intel.com" <sarah.a.sharp@linux.intel.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC/PATCH] usb/xhci: avoid kernel panic on xhci_suspend()
Date: Tue, 7 Jan 2014 21:45:58 -0800	[thread overview]
Message-ID: <20140108054558.GC19505@psi-dev26.jf.intel.com> (raw)
In-Reply-To: <20140108041620.GA9618@kroah.com>

Hi Greg,

On Tue, Jan 07, 2014 at 08:16:20PM -0800, Greg KH wrote:
> 
> A: No.
> Q: Should I include quotations after my reply?
> 
> http://daringfireball.net/2007/07/on_top
> 
> On Wed, Jan 08, 2014 at 03:49:07AM +0000, Tang, Jianqiang wrote:
> > Hi,
> >  1) I met this issue one time just boot up our Linux Platform(Kernel3.10) with XHCI driver, then kernel panic happen.
> > 
> >    And this issue reported once by other internal team.
> > 
> >    Nothing special of reproduce step and do not need special Hardware I think.
> > 
> >    Just random issue which will happen when meet the timing condition.
> > 
> >  2) This issue is introduced by this patch:
> > 
> >      https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=596d789a211d134dc5f94d1e5957248c204ef850
> > 
> >    which set all hub autosuspend delay to 0.
> 
> That patch was released in a kernel almost a full year ago, yet we have
> never had a report of this happening before, so are you sure this patch
> is the root cause?

This bug happened in a platform with 1 usb3 host controller + 1 usb3 OTG
controller (Jianqiang, please correct me if I'm wrong).
How common is this configuration out there?

Br, David Cohen

> 
> >    This causes race condition during XHCI driver initialization,
> > 
> >     After USB2 hcd and USB2 root hub finish the initialization, USB2 root hub is functional and auto suspend right now, hence trigger XHCI runtime suspend flow;
> > 
> >     At the same time, XHCI driver continue to initialize the USB3 hcd and assign to xhci->shared_hcd after finish the initialization;
> >     
> >     Since xhci_suspend() use the xhci->shared_hcd, so there is race condition that when XHCI runtime suspend called, xhci->shared_hcd still NULL.
> > 
> >     I think this patch is a fix solution since before XHCI finish the whole initialization, USB2 root hub triggered runtime suspend is mean less and do not need to handle.
> 
> With this patch applied, does the crash go away?

      reply	other threads:[~2014-01-08  5:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-08  1:44 [RFC/PATCH] usb/xhci: avoid kernel panic on xhci_suspend() David Cohen
2014-01-08  1:45 ` Greg KH
2014-01-08 15:48   ` Alan Stern
2014-01-08 19:53     ` David Cohen
2014-02-21 13:29       ` Mathias Nyman
2014-01-08  1:46 ` Greg KH
2014-01-08  3:49   ` Tang, Jianqiang
2014-01-08  4:16     ` Greg KH
2014-01-08  5:45       ` David Cohen [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=20140108054558.GC19505@psi-dev26.jf.intel.com \
    --to=david.a.cohen@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jianqiang.tang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sarah.a.sharp@linux.intel.com \
    --cc=stern@rowland.harvard.edu \
    /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