usb: gadget: fsl_udc: wmb ep_td struct when submitting to controller
authorColin Cross <ccross@android.com>
Wed, 3 Mar 2010 01:25:41 +0000 (17:25 -0800)
committerColin Cross <ccross@android.com>
Wed, 6 Oct 2010 23:26:36 +0000 (16:26 -0700)
Since these get allocated dmacoherent instead of noncacheable in armv7, we need
to do wmb before handing them to hardware.

Change-Id: I413eeb6da3bfeb754c4b475b19fe5823d83d3d04
Signed-off-by: Colin Cross <ccross@android.com>
Cc: Erik Gilling <konkers@android.com>
drivers/usb/gadget/fsl_udc_core.c

index 68fae9b023d84dbe4b07237c00cd93a7d2c6cb83..f059f5ef7828062f9343b9b72a30bf2b0c6ed5a0 100644 (file)
@@ -670,6 +670,9 @@ static void fsl_queue_td(struct fsl_ep *ep, struct fsl_req *req)
                ? (1 << (ep_index(ep) + 16))
                : (1 << (ep_index(ep)));
 
+       /* Flush all the dTD structs out to memory */
+       wmb();
+
        /* check if the pipe is empty */
        if (!(list_empty(&ep->queue))) {
                /* Add td to the end */
@@ -677,6 +680,7 @@ static void fsl_queue_td(struct fsl_ep *ep, struct fsl_req *req)
                lastreq = list_entry(ep->queue.prev, struct fsl_req, queue);
                lastreq->tail->next_td_ptr =
                        cpu_to_le32(req->head->td_dma & DTD_ADDR_MASK);
+               wmb();
                /* Read prime bit, if 1 goto done */
                if (fsl_readl(&dr_regs->endpointprime) & bitmask)
                        goto out;