Re: [PATCH RESEND] xhci: Prevent deadlock when xhci adapter breaks during init

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
> ---
>  drivers/usb/host/xhci.c | 22 +++++++++++++++++++---

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

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




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux