* [PATCH] musb_host: fix lockup on rxcsr_h_error
@ 2016-04-26 6:45 Max Uvarov
2016-04-26 14:05 ` Sergei Shtylyov
0 siblings, 1 reply; 2+ messages in thread
From: Max Uvarov @ 2016-04-26 6:45 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-usb, gregkh, balbi, 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.
Signed-off-by: Max Uvarov <muvarov@gmail.com>
---
drivers/usb/musb/musb_host.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index c3d5fc9..f82d0ae 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -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);
--
1.9.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] musb_host: fix lockup on rxcsr_h_error
2016-04-26 6:45 [PATCH] musb_host: fix lockup on rxcsr_h_error Max Uvarov
@ 2016-04-26 14:05 ` Sergei Shtylyov
0 siblings, 0 replies; 2+ messages in thread
From: Sergei Shtylyov @ 2016-04-26 14:05 UTC (permalink / raw)
To: Max Uvarov, linux-kernel; +Cc: linux-usb, gregkh, balbi
Hello.
On 4/26/2016 9:45 AM, Max Uvarov wrote:
> 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.
>
> Signed-off-by: Max Uvarov <muvarov@gmail.com>
> ---
> drivers/usb/musb/musb_host.c | 13 ++++++-------
> 1 file changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
> index c3d5fc9..f82d0ae 100644
> --- a/drivers/usb/musb/musb_host.c
> +++ b/drivers/usb/musb/musb_host.c
> @@ -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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-04-26 14:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-26 6:45 [PATCH] musb_host: fix lockup on rxcsr_h_error Max Uvarov
2016-04-26 14:05 ` Sergei Shtylyov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®