Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753157AbcD0GwR (ORCPT ); Wed, 27 Apr 2016 02:52:17 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:33247 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752661AbcD0GwQ (ORCPT ); Wed, 27 Apr 2016 02:52:16 -0400 From: Max Uvarov To: linux-kernel@vger.kernel.org Cc: linux-usb@vger.kernel.org, gregkh@linuxfoundation.org, sergei.shtylyov@cogentembedded.com, Max Uvarov Subject: [PATCHv2] musb_host: fix lockup on rxcsr_h_error Date: Wed, 27 Apr 2016 09:51:58 +0300 Message-Id: <1461739918-9583-1-git-send-email-muvarov@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1487 Lines: 42 Fix soft lockup when resetting remote device attached to usb host. Configuration: pppd -> musb hub -> usb-serial -> gsm modem When gsm modem resets, musb rolls in incoming rx interrupts which does not give any time to other application as result it totally lock ups. Solution is to keep original logic for RXCSR_H_ERROR and merge RXCSR_DATAERROR and RXCSR_H_ERROR branches to call same code for setting rx stall with MUSB_RXCSR_H_WZC_BITS. Signed-off-by: Max Uvarov --- v2: use bitwise or for error flags before logical and. (Sergei Shtylyov). drivers/usb/musb/musb_host.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index c3d5fc9..2d9aa78 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -1592,14 +1592,12 @@ void musb_host_rx(struct musb *musb, u8 epnum) /* stall; record URB status */ status = -EPIPE; + } else if (rx_csr & (MUSB_RXCSR_DATAERROR | MUSB_RXCSR_H_ERROR)) { - } else if (rx_csr & MUSB_RXCSR_H_ERROR) { - dev_dbg(musb->controller, "end %d RX proto error\n", epnum); - - status = -EPROTO; - musb_writeb(epio, MUSB_RXINTERVAL, 0); - - } else if (rx_csr & MUSB_RXCSR_DATAERROR) { + if (rx_csr & MUSB_RXCSR_H_ERROR) { + status = -EPROTO; + musb_writeb(epio, MUSB_RXINTERVAL, 0); + } if (USB_ENDPOINT_XFER_ISOC != qh->type) { dev_dbg(musb->controller, "RX end %d NAK timeout\n", epnum); -- 1.9.1