linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2] musb_host: fix lockup on rxcsr_h_error
@ 2016-04-27  6:51 Max Uvarov
  2016-04-27 15:46 ` Bin Liu
  0 siblings, 1 reply; 28+ messages in thread
From: Max Uvarov @ 2016-04-27  6:51 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-usb, gregkh, sergei.shtylyov, Max Uvarov

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 <muvarov@gmail.com>
---
 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

^ permalink raw reply related	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2018-08-06 13:20 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-27  6:51 [PATCHv2] musb_host: fix lockup on rxcsr_h_error Max Uvarov
2016-04-27 15:46 ` Bin Liu
2016-04-27 18:26   ` Maxim Uvarov
2016-04-27 19:13     ` Bin Liu
2016-04-27 21:28       ` Bin Liu
2016-04-28  6:51         ` Maxim Uvarov
2016-04-28 14:37           ` Bin Liu
2016-05-03 10:03             ` Yegor Yefremov
2016-05-03 13:48               ` Bin Liu
2016-05-03 14:25                 ` Yegor Yefremov
2016-05-03 14:35                   ` Bin Liu
2016-05-04 14:49                     ` Yegor Yefremov
2016-05-04 18:56                       ` Bin Liu
2016-05-04 19:02                         ` Sergei Shtylyov
2016-05-04 19:17                           ` Bin Liu
2016-05-04 20:19                             ` Greg KH
2016-05-04 20:47                               ` Bin Liu
2016-05-05 13:21                             ` Sergei Shtylyov
2016-05-05 13:31                               ` Bin Liu
2016-05-05 13:39                                 ` Sergei Shtylyov
2016-05-05 13:45                                   ` Bin Liu
2018-01-25 15:45                   ` Bin Liu
2018-01-25 16:24                     ` Maxim Uvarov
2018-01-25 16:31                       ` Bin Liu
2018-01-26  9:24                         ` Maxim Uvarov
2018-02-08  2:38                           ` Bin Liu
2018-01-26 10:42                       ` Tomas Paukrt
2018-08-06 13:19                         ` Tomas Paukrt

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).