summaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb/musb_host.c
diff options
context:
space:
mode:
authorsupriya karanth <supriya.karanth@stericsson.com>2013-01-04 17:10:33 +0530
committerFelipe Balbi <balbi@ti.com>2013-01-17 15:45:44 +0200
commita70b84421be5eebde59b0c9e15d20f316e1fbea9 (patch)
treeca35adb0a160a9b2334cf40bc78a6bca9385ac85 /drivers/usb/musb/musb_host.c
parent8df4ce75189807783c4bb4e4337e0f89283e6ca3 (diff)
usb: musb: Double buffering issues in host mode TX
Whenever an URB is programmed for transfer, the TXFIFO is flushed. This results in valid packets of the previous transfer to get flushed when double buffering is enabled (The MUSB_TXCSR_FIFONOTEMPTY bit in TXCSR is set indicating that a packet in the FIFO is yet to be sent) For ex:- In Host mode Audio, noise is heard in the headset when double buffering is enabled on the ISO endpoint. The fifo flush is removed for double buffering case. The fifo is now flushed only in cases of error or when aborting a transfer. Also, In Host MSC case, data toggle errors are seen when double buffering is enabled on the bulk endpoint. Whenever an URB is programmed for transfer, the data toggle is set manually resulting in data toggle errors on the bus. Leave the data toggle handling upto the hardware in the double buffering case. Signed-off-by: supriya karanth <supriya.karanth@stericsson.com> Signed-off-by: Praveena NADAHALLY <praveen.nadahally@stericsson.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb/musb_host.c')
-rw-r--r--drivers/usb/musb/musb_host.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index cf3705fd78c..1ce1fcf3f3e 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -756,7 +756,13 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
/* general endpoint setup */
if (epnum) {
/* flush all old state, set default */
- musb_h_tx_flush_fifo(hw_ep);
+ /*
+ * We could be flushing valid
+ * packets in double buffering
+ * case
+ */
+ if (!hw_ep->tx_double_buffered)
+ musb_h_tx_flush_fifo(hw_ep);
/*
* We must not clear the DMAMODE bit before or in
@@ -773,11 +779,13 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
);
csr |= MUSB_TXCSR_MODE;
- if (usb_gettoggle(urb->dev, qh->epnum, 1))
- csr |= MUSB_TXCSR_H_WR_DATATOGGLE
- | MUSB_TXCSR_H_DATATOGGLE;
- else
- csr |= MUSB_TXCSR_CLRDATATOG;
+ if (!hw_ep->tx_double_buffered) {
+ if (usb_gettoggle(urb->dev, qh->epnum, 1))
+ csr |= MUSB_TXCSR_H_WR_DATATOGGLE
+ | MUSB_TXCSR_H_DATATOGGLE;
+ else
+ csr |= MUSB_TXCSR_CLRDATATOG;
+ }
musb_writew(epio, MUSB_TXCSR, csr);
/* REVISIT may need to clear FLUSHFIFO ... */