Add a wmb to fsl_queue_td before priming the endpoint. This ensures that the
modifications to the QH are seen by the hardware.
Signed-off-by: Will Newton <[email protected]>
---
drivers/usb/gadget/fsl_usb2_udc.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/usb/gadget/fsl_usb2_udc.c
b/drivers/usb/gadget/fsl_usb2_udc.c
index 1868754..dd06a5b 100644
--- a/drivers/usb/gadget/fsl_usb2_udc.c
+++ b/drivers/usb/gadget/fsl_usb2_udc.c
@@ -653,6 +653,8 @@ static int fsl_queue_td(struct fsl_ep *ep, struct
fsl_req *req)
| EP_QUEUE_HEAD_STATUS_HALT));
dQH->size_ioc_int_sts &= temp;
+ wmb();
+
/* Prime endpoint by writing 1 to ENDPTPRIME */
temp = ep_is_in(ep)
? (1 << (ep_index(ep) + 16))
--
1.5.5.2
On Tue, Jun 03, 2008 at 04:20:25PM +0100, Will Newton wrote:
> Add a wmb to fsl_queue_td before priming the endpoint. This ensures that the
> modifications to the QH are seen by the hardware.
>
> Signed-off-by: Will Newton <[email protected]>
> ---
> drivers/usb/gadget/fsl_usb2_udc.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/usb/gadget/fsl_usb2_udc.c
> b/drivers/usb/gadget/fsl_usb2_udc.c
> index 1868754..dd06a5b 100644
> --- a/drivers/usb/gadget/fsl_usb2_udc.c
> +++ b/drivers/usb/gadget/fsl_usb2_udc.c
> @@ -653,6 +653,8 @@ static int fsl_queue_td(struct fsl_ep *ep, struct
> fsl_req *req)
> | EP_QUEUE_HEAD_STATUS_HALT));
> dQH->size_ioc_int_sts &= temp;
>
> + wmb();
checkpatch.pl will complain that there's not comment above the memory
barrier. Could you just add it and in one line summarize why wmb()??
> +
> /* Prime endpoint by writing 1 to ENDPTPRIME */
> temp = ep_is_in(ep)
> ? (1 << (ep_index(ep) + 16))
> --
> 1.5.5.2
--
Best Regards,
Felipe Balbi
[email protected]
http://blog.felipebalbi.com
On Tue, Jun 3, 2008 at 6:24 PM, Felipe Balbi <[email protected]> wrote:
> On Tue, Jun 03, 2008 at 04:20:25PM +0100, Will Newton wrote:
>> Add a wmb to fsl_queue_td before priming the endpoint. This ensures that the
>> modifications to the QH are seen by the hardware.
>>
>> Signed-off-by: Will Newton <[email protected]>
>> ---
>> drivers/usb/gadget/fsl_usb2_udc.c | 2 ++
>> 1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/usb/gadget/fsl_usb2_udc.c
>> b/drivers/usb/gadget/fsl_usb2_udc.c
>> index 1868754..dd06a5b 100644
>> --- a/drivers/usb/gadget/fsl_usb2_udc.c
>> +++ b/drivers/usb/gadget/fsl_usb2_udc.c
>> @@ -653,6 +653,8 @@ static int fsl_queue_td(struct fsl_ep *ep, struct
>> fsl_req *req)
>> | EP_QUEUE_HEAD_STATUS_HALT));
>> dQH->size_ioc_int_sts &= temp;
>>
>> + wmb();
>
> checkpatch.pl will complain that there's not comment above the memory
> barrier. Could you just add it and in one line summarize why wmb()??
Yes, I'll do that and resend the patch along with the rest of the series I have.
My checkpatch does not seem to complain about the missing comment btw.