Skip to contentSkip to conversation

musb_host: fix lockup on rxcsr_h_error

PATCH Superseded Max Uvarov 2 participants 2 messages Apr 26, 2016

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Max Uvarov

author
#0 lore raw

PATCH 1/1 musb_host: fix lockup on rxcsr_h_error

Fix soft lockup when resetting remote device attached
to usb host. Configuration:
pppd -> musb hub -> usb-serial -> gms 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.

---
 drivers/usb/musb/musb_host.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/usb/musb/musb_host.c +6 -7
index c3d5fc9..f82d0ae 100644
@@ -1592,14 +1592,13 @@ void musb_host_rx(struct musb *musb, u8 epnum)
 
 		/* stall; record URB status */
 		status = -EPIPE;
+	} else if (rx_csr & MUSB_RXCSR_DATAERROR ||
+		   rx_csr & 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);
Signature · 1 line
1.9.1
#1 lore raw

Hello.

Quoted 19 lines · Max Uvarov

Fix soft lockup when resetting remote device attached
to usb host. Configuration:
pppd -> musb hub -> usb-serial -> gms 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.

---
 drivers/usb/musb/musb_host.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/usb/musb/musb_host.c +0 -0
index c3d5fc9..f82d0ae 100644

drivers/usb/musb/musb_host.c void musb_host_rx(struct musb *musb, u8 epnum) · line 1596

Quoted 5 lines
drivers/usb/musb/musb_host.c +2 -0
@@ -1592,14 +1592,13 @@ void musb_host_rx(struct musb *musb, u8 epnum)
 
 		/* stall; record URB status */
 		status = -EPIPE;
+	} else if (rx_csr & MUSB_RXCSR_DATAERROR ||
+		   rx_csr & MUSB_RXCSR_H_ERROR) {
	} else if (rx_csr & (MUSB_RXCSR_DATAERROR | MUSB_RXCSR_H_ERROR)) {

[...]

MBR, Sergei