Hello. Swaminathan S wrote:
This patch updates the "busy" field to reflect the current status of the endpoint. This fix is critical to enable the request queuing logic to prevent a queued request from overwriting/interfering in-flight request.
Frankly speaking, I'm not seeing how a newly queued request can overwrite anything as it's only started being *at the head of the request queue* (which it won't be unless it's queued onto an already empty queue with the last request has been already done). Moreover, ep->busy will have already been set by musb_g_givebck() iff the queue() method is called from the request completion handler, so musb_ep_restart() cannotr be called from there at this time. What this is really fixing is your broken logic in the prior patch about which so many spears have been broken already, if I don't mistake, and in this case these patches should be merged. But I do think that your whole approach to stalling/aborting in flight request is wrong and that's what should be fixed instead.
Signed-off-by: Swaminathan S <[EMAIL PROTECTED]> --- drivers/usb/musb/musb_gadget.c | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index 491a3e7..38daf66 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -106,7 +106,6 @@ __acquires(ep->musb->lock) { struct musb_request *req; struct musb *musb; - int busy = ep->busy;req = to_musb_request(request); @@ -115,7 +114,6 @@ __acquires(ep->musb->lock)req->request.status = status; musb = req->musb;- ep->busy = 1;spin_unlock(&musb->lock); if (is_dma_capable()) { if (req->mapped) { @@ -146,7 +144,7 @@ __acquires(ep->musb->lock) request->status); req->request.complete(&req->ep->end_point, &req->request); spin_lock(&musb->lock); - ep->busy = busy; + ep->busy = 0; }/* ----------------------------------------------------------------------- */@@ -187,7 +185,10 @@ static void nuke(struct musb_ep *ep, const int status) req = container_of(ep->req_list.next, struct musb_request, request.list); musb_g_giveback(ep, &req->request, status); + ep->busy = 1; } + + ep->busy = 0; }/* ----------------------------------------------------------------------- */@@ -288,6 +289,8 @@ static void txstate(struct musb *musb, struct musb_request *req) DBG(4, "hw_ep%d, maxpacket %d, fifo count %d, txcsr %03x\n", epnum, musb_ep->packet_sz, fifo_count, csr); + + musb_ep->busy = 1;#ifndef CONFIG_MUSB_PIO_ONLYif (is_dma_capable() && musb_ep->dma) { @@ -580,6 +583,8 @@ static void rxstate(struct musb *musb, struct musb_request *req)csr = musb_readw(epio, MUSB_RXCSR); + musb_ep->busy = 1;+ if (is_cppi_enabled() && musb_ep->dma) { struct dma_controller *c = musb->dma_controller; struct dma_channel *channel = musb_ep->dma;
WBR. Sergei _______________________________________________ Davinci-linux-open-source mailing list [email protected] http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
