summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@freescale.com>2011-08-11 10:51:45 +0800
committerPeter Chen <peter.chen@freescale.com>2011-08-19 10:02:36 +0800
commit359943791faf6485016d89b8a160f4843128bdc9 (patch)
tree46ac3e570c4ff9c8a4c3a2955c5e9dcde6706bac
parentb97ac3cd36229c4e02eb16de2dac3bee5e3e5a56 (diff)
ENGR00154704 usb-gadget: wmb is needed after dtd pointer is updated for armv7
At armv7 SoC, the dma_alloc_coherent returns non-cachable, but bufferable region, so the driver needs to drain write buffer by itself, if the controller needs to visit dma buffer immediately after cpu writes There is a discussion for this armv7 change: http://marc.info/?t=127918539100004&r=1&w=2 For this issue, the next dtd pointer is invalid sometimes, the reason is the region which is used to store dtd is dma buffer, so the data may not be written to memory when the controller visit this data. Signed-off-by: Peter Chen <peter.chen@freescale.com>
-rw-r--r--drivers/usb/gadget/arcotg_udc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/gadget/arcotg_udc.c b/drivers/usb/gadget/arcotg_udc.c
index 9711b7f7c643..44e3eed8dc02 100644
--- a/drivers/usb/gadget/arcotg_udc.c
+++ b/drivers/usb/gadget/arcotg_udc.c
@@ -877,6 +877,9 @@ static int fsl_queue_td(struct fsl_ep *ep, struct fsl_req *req)
lastreq->tail->next_td_ptr =
cpu_to_hc32(req->head->td_dma & DTD_ADDR_MASK);
}
+ #ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE
+ wmb();
+ #endif
/* Read prime bit, if 1 goto done */
if (fsl_readl(&dr_regs->endpointprime) & bitmask)
goto out;