From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Date: Sat, 21 Feb 2009 23:31:13 +0000 (-0800)
Subject: USB: musb: fix data toggle saving with shared FIFO
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=51d9f3e100a8f8cc2be89d5f13d37de61e2da38a;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git

USB: musb: fix data toggle saving with shared FIFO

For some strange reason the host side musb_giveback() decides
that it's always got an IN transfer when the hardware endpoint
is using a shared FIFO.  This causes musb_save_toggle() to read
the toggle state from the RXCSR register instead of TXCSR, and
may also cause unneeded reloading of RX endpoint registers.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---

diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index c74ebadd4b9d..fc79e76b3845 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -335,16 +335,11 @@ musb_save_toggle(struct musb_hw_ep *ep, int is_in, struct urb *urb)
 static struct musb_qh *
 musb_giveback(struct musb_qh *qh, struct urb *urb, int status)
 {
-	int			is_in;
 	struct musb_hw_ep	*ep = qh->hw_ep;
 	struct musb		*musb = ep->musb;
+	int			is_in = usb_pipein(urb->pipe);
 	int			ready = qh->is_ready;
 
-	if (ep->is_shared_fifo)
-		is_in = 1;
-	else
-		is_in = usb_pipein(urb->pipe);
-
 	/* save toggle eagerly, for paranoia */
 	switch (qh->type) {
 	case USB_ENDPOINT_XFER_BULK: