Reset endpoint data toggle would lead to failure for musb
RTL version 1.9 on blackfin.

Signed-off-by: Scott Jiang <[email protected]>
---
 drivers/usb/musb/musb_host.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index a9695f5..0bc59fd 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -590,7 +590,10 @@ musb_rx_reinit(struct musb *musb, struct musb_qh *qh, 
struct musb_hw_ep *ep)
                        WARNING("rx%d, packet/%d ready?\n", ep->epnum,
                                musb_readw(ep->regs, MUSB_RXCOUNT));
 
-               musb_h_flush_rxfifo(ep, MUSB_RXCSR_CLRDATATOG);
+               if (csr & MUSB_TXCSR_MODE)
+                       musb_h_flush_rxfifo(ep, MUSB_RXCSR_CLRDATATOG);
+               else
+                       musb_h_flush_rxfifo(ep, 0);
        }
 
        /* target addr and (for multipoint) hub addr/port */
@@ -786,7 +789,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
                                if (usb_gettoggle(urb->dev, qh->epnum, 1))
                                        csr |= MUSB_TXCSR_H_WR_DATATOGGLE
                                                | MUSB_TXCSR_H_DATATOGGLE;
-                               else
+                               else if (csr & MUSB_TXCSR_MODE)
                                        csr |= MUSB_TXCSR_CLRDATATOG;
                        }
 
-- 
1.7.0.4


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to