linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Bill Kuzeja <William.Kuzeja@stratus.com>
Cc: linux-usb@vger.kernel.org, torez@redhat.com
Subject: Re: [PATCH RESEND] xhci: Prevent deadlock when xhci adapter breaks during init
Date: Tue, 3 Sep 2019 15:45:29 +0200	[thread overview]
Message-ID: <20190903134529.GC9435@kroah.com> (raw)
In-Reply-To: <1567102335-5231-1-git-send-email-William.Kuzeja@stratus.com>

On Thu, Aug 29, 2019 at 02:12:15PM -0400, Bill Kuzeja wrote:
> The system can hit a deadlock if xhci adapter breaks while initializing. 
> The deadlock is between two threads: thread 1 is tearing down the 
> adapter and is stuck in usb_unlocked_disable_lpm waiting to lock the 
> hcd->handwidth_mutex. Thread 2 is holding this mutex (while still trying 
> to add a usb device), but is stuck in xhci_endpoint_reset waiting for a 
> stop or config command to complete. A reboot is required to resolve. 
> 
> It turns out when calling xhci_queue_stop_endpoint and 
> xhci_queue_configure_endpoint in xhci_endpoint_reset, the return code is
> not checked for errors. If the timing is right and the adapter dies just
> before either of these commands get issued, we hang indefinitely waiting 
> for a completion on a command that didn't get issued.
> 
> This wasn't a problem before the following fix because we didn't send 
> commands in xhci_endpoint_reset:
> 
> commit f5249461b504 ("xhci: Clear the host side toggle manually when endpoint is soft reset")
> 
> With the patch I am submitting, a duration test which breaks adapters 
> during initialization (and which deadlocks with the standard kernel) runs 
> without issue.
> 
> Fixes: f5249461b504 ("xhci: Clear the host side toggle manually when endpoint is soft reset")
> Signed-off-by: Bill Kuzeja <william.kuzeja@stratus.com>
> ---
>  drivers/usb/host/xhci.c | 22 +++++++++++++++++++---

$ ./scripts/get_maintainer.pl --file drivers/usb/host/xhci.c
Mathias Nyman <mathias.nyman@intel.com> (supporter:USB XHCI DRIVER)
Greg Kroah-Hartman <gregkh@linuxfoundation.org> (supporter:USB SUBSYSTEM)
linux-usb@vger.kernel.org (open list:USB XHCI DRIVER)
linux-kernel@vger.kernel.org (open list)

I think you forgot to send this to the xhci driver maintainer for review
:(


  reply	other threads:[~2019-09-03 13:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-29 18:12 [PATCH RESEND] xhci: Prevent deadlock when xhci adapter breaks during init Bill Kuzeja
2019-09-03 13:45 ` Greg KH [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-08-15 15:49 Bill Kuzeja

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=20190903134529.GC9435@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=William.Kuzeja@stratus.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=torez@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).