From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754189AbcHAQ1z (ORCPT ); Mon, 1 Aug 2016 12:27:55 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:49763 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752292AbcHAQ1q (ORCPT ); Mon, 1 Aug 2016 12:27:46 -0400 X-IBM-Helo: d24dlp02.br.ibm.com X-IBM-MailFrom: krisman@linux.vnet.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org;linux-usb@vger.kernel.org From: Gabriel Krisman Bertazi To: Kamal Mostafa Cc: Mathias Nyman , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] xhci: Fix soft lockup in xhci_pci_probe path when XHCI_STATE_HALTED Organization: IBM References: <1470067718-13042-1-git-send-email-kamal@canonical.com> Date: Mon, 01 Aug 2016 13:27:38 -0300 In-Reply-To: <1470067718-13042-1-git-send-email-kamal@canonical.com> (Kamal Mostafa's message of "Mon, 1 Aug 2016 09:08:38 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16080116-0024-0000-0000-000000EB7A25 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16080116-0025-0000-0000-00001572755A Message-Id: <87eg68cv45.fsf@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-08-01_11:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1608010172 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Kamal Mostafa writes: > 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 > Signed-off-by: Kamal Mostafa > Cc: #v4.3+ > Cc: Gabriel Krisman Bertazi > Acked-by: Tim Gardner > Acked-by: Stefan Bader > --- > 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 918e0c7..1d36a5f 100644 > --- a/drivers/usb/host/xhci-ring.c > +++ b/drivers/usb/host/xhci-ring.c > @@ -2751,8 +2751,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); > @@ -2764,6 +2763,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"); > } Returning early when XHCI_STATE_HALTED is no longer necessary since my commit ensures we only free the HCD after disabling the primary HCD. I think we can drop the 'else if' leg all together and only test for XHCI_STATE_DYING here. -- Gabriel Krisman Bertazi