aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/chipidea/udc.c
diff options
context:
space:
mode:
authorStefan Wahren <stefan.wahren@i2se.com>2016-07-09 10:16:38 -0400
committerPeter Chen <peter.chen@nxp.com>2016-09-13 22:58:13 -0400
commit66b76dbe37df88b250ffdac186adba3e5dc24631 (patch)
tree2e51bc44f1797c27f57a1a932e3a09ccefcd536f /drivers/usb/chipidea/udc.c
parent050bc4e846af24e77af82d0fa5f718e0919d15a4 (diff)
usb: chipidea: udc: move write barrier into hw_ep_prime
Since there should be a write barrier before every call of hw_ep_prime we could move it into hw_ep_prime. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Peter Chen <peter.chen@nxp.com>
Diffstat (limited to 'drivers/usb/chipidea/udc.c')
-rw-r--r--drivers/usb/chipidea/udc.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index b93356834bb5..b0c4ae1cd206 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -188,6 +188,9 @@ static int hw_ep_prime(struct ci_hdrc *ci, int num, int dir, int is_ctrl)
188{ 188{
189 int n = hw_ep_bit(num, dir); 189 int n = hw_ep_bit(num, dir);
190 190
191 /* Synchronize before ep prime */
192 wmb();
193
191 if (is_ctrl && dir == RX && hw_read(ci, OP_ENDPTSETUPSTAT, BIT(num))) 194 if (is_ctrl && dir == RX && hw_read(ci, OP_ENDPTSETUPSTAT, BIT(num)))
192 return -EAGAIN; 195 return -EAGAIN;
193 196
@@ -506,8 +509,6 @@ static int _hardware_enqueue(struct ci_hw_ep *hwep, struct ci_hw_req *hwreq)
506 hwep->qh.ptr->cap |= mul << __ffs(QH_MULT); 509 hwep->qh.ptr->cap |= mul << __ffs(QH_MULT);
507 } 510 }
508 511
509 wmb(); /* synchronize before ep prime */
510
511 ret = hw_ep_prime(ci, hwep->num, hwep->dir, 512 ret = hw_ep_prime(ci, hwep->num, hwep->dir,
512 hwep->type == USB_ENDPOINT_XFER_CONTROL); 513 hwep->type == USB_ENDPOINT_XFER_CONTROL);
513done: 514done:
@@ -534,9 +535,6 @@ static int reprime_dtd(struct ci_hdrc *ci, struct ci_hw_ep *hwep,
534 hwep->qh.ptr->td.token &= 535 hwep->qh.ptr->td.token &=
535 cpu_to_le32(~(TD_STATUS_HALTED | TD_STATUS_ACTIVE)); 536 cpu_to_le32(~(TD_STATUS_HALTED | TD_STATUS_ACTIVE));
536 537
537 /* Synchronize before ep prime */
538 wmb();
539
540 return hw_ep_prime(ci, hwep->num, hwep->dir, 538 return hw_ep_prime(ci, hwep->num, hwep->dir,
541 hwep->type == USB_ENDPOINT_XFER_CONTROL); 539 hwep->type == USB_ENDPOINT_XFER_CONTROL);
542} 540}