aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/gadget/ci13xxx_udc.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/usb/gadget/ci13xxx_udc.c b/drivers/usb/gadget/ci13xxx_udc.c
index 03505cbae873..f20e861deebf 100644
--- a/drivers/usb/gadget/ci13xxx_udc.c
+++ b/drivers/usb/gadget/ci13xxx_udc.c
@@ -1794,18 +1794,20 @@ __acquires(mEp->lock)
1794 1794
1795 dbg_done(_usb_addr(mEp), mReq->ptr->token, retval); 1795 dbg_done(_usb_addr(mEp), mReq->ptr->token, retval);
1796 1796
1797 if (!list_empty(&mEp->qh[mEp->dir].queue)) {
1798 struct ci13xxx_req* mReqEnq;
1799
1800 mReqEnq = list_entry(mEp->qh[mEp->dir].queue.next,
1801 struct ci13xxx_req, queue);
1802 _hardware_enqueue(mEp, mReqEnq);
1803 }
1804
1797 if (!mReq->req.no_interrupt && mReq->req.complete != NULL) { 1805 if (!mReq->req.no_interrupt && mReq->req.complete != NULL) {
1798 spin_unlock(mEp->lock); 1806 spin_unlock(mEp->lock);
1799 mReq->req.complete(&mEp->ep, &mReq->req); 1807 mReq->req.complete(&mEp->ep, &mReq->req);
1800 spin_lock(mEp->lock); 1808 spin_lock(mEp->lock);
1801 } 1809 }
1802 1810
1803 if (!list_empty(&mEp->qh[mEp->dir].queue)) {
1804 mReq = list_entry(mEp->qh[mEp->dir].queue.next,
1805 struct ci13xxx_req, queue);
1806 _hardware_enqueue(mEp, mReq);
1807 }
1808
1809 done: 1811 done:
1810 return retval; 1812 return retval;
1811} 1813}
@@ -2170,8 +2172,10 @@ static int ep_queue(struct usb_ep *ep, struct usb_request *req,
2170 mReq->req.actual = 0; 2172 mReq->req.actual = 0;
2171 list_add_tail(&mReq->queue, &mEp->qh[mEp->dir].queue); 2173 list_add_tail(&mReq->queue, &mEp->qh[mEp->dir].queue);
2172 2174
2173 retval = _hardware_enqueue(mEp, mReq); 2175 if (list_is_singular(&mEp->qh[mEp->dir].queue))
2174 if (retval == -EALREADY || retval == -EBUSY) { 2176 retval = _hardware_enqueue(mEp, mReq);
2177
2178 if (retval == -EALREADY) {
2175 dbg_event(_usb_addr(mEp), "QUEUE", retval); 2179 dbg_event(_usb_addr(mEp), "QUEUE", retval);
2176 retval = 0; 2180 retval = 0;
2177 } 2181 }