Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Kai-Heng Feng <kai.heng.feng@canonical.com>
Cc: mathias.nyman@intel.com, linux-stable@vger.kernel.org,
	Mathias Nyman <mathias.nyman@linux.intel.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH] xhci: Fix perceived dead host due to runtime suspend race with event handler
Date: Wed, 18 Jul 2018 18:26:36 +0200	[thread overview]
Message-ID: <20180718162636.GA26902@kroah.com> (raw)
In-Reply-To: <20180718162322.9518-1-kai.heng.feng@canonical.com>

On Thu, Jul 19, 2018 at 12:23:22AM +0800, Kai-Heng Feng wrote:
> From: Mathias Nyman <mathias.nyman@linux.intel.com>
> 
> commit 229bc19fd7aca4f37964af06e3583c1c8f36b5d6 upstream.
> 
> Don't rely on event interrupt (EINT) bit alone to detect pending port
> change in resume. If no change event is detected the host may be suspended
> again, oterwise roothubs are resumed.
> 
> There is a lag in xHC setting EINT. If we don't notice the pending change
> in resume, and the controller is runtime suspeded again, it causes the
> event handler to assume host is dead as it will fail to read xHC registers
> once PCI puts the controller to D3 state.
> 
> [  268.520969] xhci_hcd: xhci_resume: starting port polling.
> [  268.520985] xhci_hcd: xhci_hub_status_data: stopping port polling.
> [  268.521030] xhci_hcd: xhci_suspend: stopping port polling.
> [  268.521040] xhci_hcd: // Setting command ring address to 0x349bd001
> [  268.521139] xhci_hcd: Port Status Change Event for port 3
> [  268.521149] xhci_hcd: resume root hub
> [  268.521163] xhci_hcd: port resume event for port 3
> [  268.521168] xhci_hcd: xHC is not running.
> [  268.521174] xhci_hcd: handle_port_status: starting port polling.
> [  268.596322] xhci_hcd: xhci_hc_died: xHCI host controller not responding, assume dead
> 
> The EINT lag is described in a additional note in xhci specs 4.19.2:
> 
> "Due to internal xHC scheduling and system delays, there will be a lag
> between a change bit being set and the Port Status Change Event that it
> generated being written to the Event Ring. If SW reads the PORTSC and
> sees a change bit set, there is no guarantee that the corresponding Port
> Status Change Event has already been written into the Event Ring."
> 
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
> ---
>  drivers/usb/host/xhci.c | 40 +++++++++++++++++++++++++++++++++++++---
>  drivers/usb/host/xhci.h |  4 ++++
>  2 files changed, 41 insertions(+), 3 deletions(-)

Any specific reason you sent this old patch that is already in Linus's
tree out again to everyone?

confused,

greg k-h

  reply	other threads:[~2018-07-18 17:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-18 16:23 [PATCH] xhci: Fix perceived dead host due to runtime suspend race with event handler Kai-Heng Feng
2018-07-18 16:26 ` Greg KH [this message]
2018-07-18 16:29   ` Kai-Heng Feng
2018-07-18 16:34     ` Greg KH
2018-07-18 18:19       ` Kai-Heng Feng
2018-07-19  9:11         ` Mathias Nyman
2018-07-22 17:30           ` Kai-Heng Feng
2018-07-18 16:27 ` Kai-Heng Feng

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=20180718162636.GA26902@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=kai.heng.feng@canonical.com \
    --cc=linux-stable@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=mathias.nyman@linux.intel.com \
    --cc=stable@vger.kernel.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