aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAnand Gadiyar <gadiyar@ti.com>2008-08-21 10:51:00 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-08-21 13:26:34 -0400
commitfb85d991616046f1b640ed9c4eab9b44908dab74 (patch)
tree3af15b058a217f2411329711511870b736485386 /drivers
parente8164f64caff68d4e878e1719d88d145faa75f1d (diff)
MUSB: Fix index register corruption seen with g_ether and Windows host
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> Acked-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/musb/musb_gadget_ep0.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/musb/musb_gadget_ep0.c b/drivers/usb/musb/musb_gadget_ep0.c
index 48d7d3ccb243..a57652fff39c 100644
--- a/drivers/usb/musb/musb_gadget_ep0.c
+++ b/drivers/usb/musb/musb_gadget_ep0.c
@@ -476,6 +476,7 @@ static void ep0_rxstate(struct musb *musb)
476 return; 476 return;
477 musb->ackpend = 0; 477 musb->ackpend = 0;
478 } 478 }
479 musb_ep_select(musb->mregs, 0);
479 musb_writew(regs, MUSB_CSR0, tmp); 480 musb_writew(regs, MUSB_CSR0, tmp);
480} 481}
481 482
@@ -528,6 +529,7 @@ static void ep0_txstate(struct musb *musb)
528 } 529 }
529 530
530 /* send it out, triggering a "txpktrdy cleared" irq */ 531 /* send it out, triggering a "txpktrdy cleared" irq */
532 musb_ep_select(musb->mregs, 0);
531 musb_writew(regs, MUSB_CSR0, csr); 533 musb_writew(regs, MUSB_CSR0, csr);
532} 534}
533 535