From 9665eb6d36c02ee8678e298d620a317979171764 Mon Sep 17 00:00:00 2001 From: Kamal Mostafa Date: Fri, 22 Jul 2016 09:25:51 -0700 Subject: TEST: xhci: Fix soft lockup in xhci_pci_probe path when XHCI_STATE_HALTED Commit 27a41a83ec54 ("xhci: Cleanup only when releasing primary hcd") causes a soft lockup at boot when XHCI_STATE_HALTED, preventing VirtualBox 5.1.x from booting if USB3.0 is enabled. Revert to allowing xhci_irq to handle the interrupt when XHCI_STATE_HALTED but not XHCI_STATE_DYING. Fixes: 27a41a83ec54 ("xhci: Cleanup only when releasing primary hcd") BugLink: https://bugs.launchpad.net/bugs/1604058 Cc: #v4.3+ Signed-off-by: Kamal Mostafa --- drivers/usb/host/xhci-ring.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 135164b..d4b0be8 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -2744,8 +2744,7 @@ hw_died: writel(irq_pending, &xhci->ir_set->irq_pending); } - if (xhci->xhc_state & XHCI_STATE_DYING || - xhci->xhc_state & XHCI_STATE_HALTED) { + if (xhci->xhc_state & XHCI_STATE_DYING) { xhci_dbg(xhci, "xHCI dying, ignoring interrupt. " "Shouldn't IRQs be disabled?\n"); /* Clear the event handler busy flag (RW1C); @@ -2757,6 +2756,8 @@ hw_died: spin_unlock(&xhci->lock); return IRQ_HANDLED; + } else if (xhci->xhc_state & XHCI_STATE_HALTED) { + xhci_dbg(xhci, "xHCI halted, handling interrupt.\n"); } event_ring_deq = xhci->event_ring->dequeue; -- 2.7.4