]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.6.4/usb-musb-ensure-rx-reinit-occurs-for-shared_fifo-endpoints.patch
5.0-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.6.4 / usb-musb-ensure-rx-reinit-occurs-for-shared_fifo-endpoints.patch
CommitLineData
e370d1cd
GKH
1From f3eec0cf784e0d6c47822ca6b66df3d5812af7e6 Mon Sep 17 00:00:00 2001
2From: Andrew Goodbody <andrew.goodbody@cambrionix.com>
3Date: Tue, 31 May 2016 10:05:26 -0500
4Subject: usb: musb: Ensure rx reinit occurs for shared_fifo endpoints
5
6From: Andrew Goodbody <andrew.goodbody@cambrionix.com>
7
8commit f3eec0cf784e0d6c47822ca6b66df3d5812af7e6 upstream.
9
10shared_fifo endpoints would only get a previous tx state cleared
11out, the rx state was only cleared for non shared_fifo endpoints
12Change this so that the rx state is cleared for all endpoints.
13This addresses an issue that resulted in rx packets being dropped
14silently.
15
16Signed-off-by: Andrew Goodbody <andrew.goodbody@cambrionix.com>
17Signed-off-by: Bin Liu <b-liu@ti.com>
18Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19
20---
21 drivers/usb/musb/musb_host.c | 13 ++++++-------
22 1 file changed, 6 insertions(+), 7 deletions(-)
23
24--- a/drivers/usb/musb/musb_host.c
25+++ b/drivers/usb/musb/musb_host.c
26@@ -594,14 +594,13 @@ musb_rx_reinit(struct musb *musb, struct
27 musb_writew(ep->regs, MUSB_TXCSR, 0);
28
29 /* scrub all previous state, clearing toggle */
30- } else {
31- csr = musb_readw(ep->regs, MUSB_RXCSR);
32- if (csr & MUSB_RXCSR_RXPKTRDY)
33- WARNING("rx%d, packet/%d ready?\n", ep->epnum,
34- musb_readw(ep->regs, MUSB_RXCOUNT));
35-
36- musb_h_flush_rxfifo(ep, MUSB_RXCSR_CLRDATATOG);
37 }
38+ csr = musb_readw(ep->regs, MUSB_RXCSR);
39+ if (csr & MUSB_RXCSR_RXPKTRDY)
40+ WARNING("rx%d, packet/%d ready?\n", ep->epnum,
41+ musb_readw(ep->regs, MUSB_RXCOUNT));
42+
43+ musb_h_flush_rxfifo(ep, MUSB_RXCSR_CLRDATATOG);
44
45 /* target addr and (for multipoint) hub addr/port */
46 if (musb->is_multipoint) {