--- linux_mv_davinci/drivers/usb/musb/g_ep0.c.orig 2007-05-09 10:56:29.000000000 -0400 +++ linux_mv_davinci/drivers/usb/musb/g_ep0.c 2007-03-22 15:16:35.000000000 -0400 @@ -196,7 +196,6 @@ service_in_request(struct musb *pThis, */ static void musb_g_ep0_giveback(struct musb *pThis, struct usb_request *req) { - pThis->ep0_state = MGC_END0_STAGE_SETUP; musb_g_giveback(&pThis->aLocalEnd[0].ep_in, req, 0); } @@ -456,7 +455,6 @@ static void ep0_rxstate(struct musb *thi req = NULL; } else tmp = MGC_M_CSR0_P_SVDRXPKTRDY | MGC_M_CSR0_P_SENDSTALL; - musb_writew(regs, MGC_O_HDRC_CSR0, tmp); /* NOTE: we "should" hold off reporting DATAEND and going to @@ -465,6 +463,7 @@ static void ep0_rxstate(struct musb *thi */ if (req) musb_g_ep0_giveback(this, req); + musb_writew(regs, MGC_O_HDRC_CSR0, tmp); } /* @@ -503,7 +502,6 @@ static void ep0_txstate(struct musb *pTh pRequest = NULL; /* send it out, triggering a "txpktrdy cleared" irq */ - musb_writew(regs, MGC_O_HDRC_CSR0, wCsrVal); /* report completions as soon as the fifo's loaded; there's no * win in waiting till this last packet gets acked. (other than @@ -512,6 +510,7 @@ static void ep0_txstate(struct musb *pTh */ if (pRequest) musb_g_ep0_giveback(pThis, pRequest); + musb_writew(regs, MGC_O_HDRC_CSR0, wCsrVal); } /* @@ -937,6 +936,8 @@ static int musb_g_ep0_halt(struct usb_ep case MGC_END0_STAGE_TX: /* control-IN data */ case MGC_END0_STAGE_ACKWAIT: /* STALL for zero-length data */ case MGC_END0_STAGE_RX: /* control-OUT data */ + case MGC_END0_STAGE_STATUSIN: /* control-OUT status */ + case MGC_END0_STAGE_STATUSOUT: /* control-IN status */ status = 0; MGC_SelectEnd(base, 0);