[PATCH 10/11] fsl_usb2_udc: Add a wmb before priming endpoint.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Will Newton
Date: Tuesday, August 12, 2008 - 7:39 am

From: Will Newton <will.newton@gmail.com>

Add a wmb to fsl_queue_td before priming the endpoint. This ensures that the
modifications to the QH are seen by the hardware.

Added comment as suggested by Felipe Balbi.

Signed-off-by: Will Newton <will.newton@gmail.com>
Acked-by: Li Yang <leoli@freescale.com>
---
 drivers/usb/gadget/fsl_usb2_udc.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/gadget/fsl_usb2_udc.c b/drivers/usb/gadget/fsl_usb2_udc.c
index 10fafbb..79c36eb 100644
--- a/drivers/usb/gadget/fsl_usb2_udc.c
+++ b/drivers/usb/gadget/fsl_usb2_udc.c
@@ -643,6 +643,9 @@ static void fsl_queue_td(struct fsl_ep *ep, struct fsl_req *req)
 			| EP_QUEUE_HEAD_STATUS_HALT));
 	dQH->size_ioc_int_sts &= temp;
 
+	/* Ensure that updates to the QH will occure before priming. */
+	wmb();
+
 	/* Prime endpoint by writing 1 to ENDPTPRIME */
 	temp = ep_is_in(ep)
 		? (1 << (ep_index(ep) + 16))
-- 
1.5.5.2

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 10/11] fsl_usb2_udc: Add a wmb before priming endpoint., Will Newton, (Tue Aug 12, 7:39 am)
[PATCH 11/11] fsl_usb2_udc: Fix oops on probe failure., Will Newton, (Tue Aug 12, 7:39 am)