public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MUSB: Fix index register corruption seen with g_ether and Windows host
@ 2008-08-21 14:51 Gadiyar, Anand
       [not found] ` <5A47E75E594F054BAF48C5E4FC4B92AB02C3E31565-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Gadiyar, Anand @ 2008-08-21 14:51 UTC (permalink / raw)
  To: greg@kroah.com, linux-usb@vger.kernel.org
  Cc: linux-omap@vger.kernel.org, felipe.balbi@nokia.com, Tony Lindgren

From: Anand Gadiyar <gadiyar@ti.com>

If Indexed Mode register accesses are enabled, the ep0_rxstate()
function calls musb_g_ep0_giveback() before writing to the CSR
register. When control returns to this ep0_rxstate, the index
register contents are over-written. This causes the CSR register
write to fail.

Fixed by writing the correct value into the index register before
writing to the CSR.

This was observed only in ep0_rxstate() with g_ether loaded and
the device connected to a MS Windows host PC. Anticipatively fixed
ep0_txstate() as well.

Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
---
Fixed my mailer finally. :)

 drivers/usb/musb/musb_gadget_ep0.c |    2 ++
 1 files changed, 2 insertions(+)

Index: linux-omap-2.6/drivers/usb/musb/musb_gadget_ep0.c
===================================================================
--- linux-omap-2.6.orig/drivers/usb/musb/musb_gadget_ep0.c	2008-04-14 15:36:38.000000000 +0530
+++ linux-omap-2.6/drivers/usb/musb/musb_gadget_ep0.c	2008-08-21 18:12:11.688711634 +0530
@@ -476,6 +476,7 @@ static void ep0_rxstate(struct musb *mus
 			return;
 		musb->ackpend = 0;
 	}
+	musb_ep_select(musb->mregs, 0);
 	musb_writew(regs, MUSB_CSR0, tmp);
 }
 
@@ -528,6 +529,7 @@ static void ep0_txstate(struct musb *mus
 	}
 
 	/* send it out, triggering a "txpktrdy cleared" irq */
+	musb_ep_select(musb->mregs, 0);
 	musb_writew(regs, MUSB_CSR0, csr);
 }
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-08-21 16:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-21 14:51 [PATCH] MUSB: Fix index register corruption seen with g_ether and Windows host Gadiyar, Anand
     [not found] ` <5A47E75E594F054BAF48C5E4FC4B92AB02C3E31565-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2008-08-21 14:58   ` Felipe Balbi
2008-08-21 16:05   ` patch musb-fix-index-register-corruption-seen-with-g_ether-and-windows-host.patch added to gregkh-2.6 tree gregkh-l3A5Bk7waGM

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox