summaryrefslogtreecommitdiff
path: root/drivers/usb/cdns3
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@nxp.com>2020-01-07 12:15:01 +0800
committerPeter Chen <peter.chen@nxp.com>2020-01-20 17:23:29 +0800
commit3e7c6dff3e9ee1d66e6beebad8d9e9f6b739483c (patch)
tree333b5d3131ac409f37854f2752410b1a6a8e1b29 /drivers/usb/cdns3
parentadb129da17716ee60d11c0cd6afd3ff5f3518007 (diff)
MLK-23181-2 usb: cdns3: gadget: add one missing condition for cdns3_request_handled
If the dequeue pointer advances to the first trb, but the priv_req->end_trb is the last trb, we consider the trb this dequeue pointer points doesn't belong to this request. Reviewed-by: Jun Li <jun.li@nxp.com> Signed-off-by: Peter Chen <peter.chen@nxp.com>
Diffstat (limited to 'drivers/usb/cdns3')
-rw-r--r--drivers/usb/cdns3/gadget.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c
index 744083e7595d..c7b163700bd4 100644
--- a/drivers/usb/cdns3/gadget.c
+++ b/drivers/usb/cdns3/gadget.c
@@ -840,9 +840,13 @@ static bool cdns3_request_handled(struct cdns3_endpoint *priv_ep,
priv_ep->trb_pool_dma) / TRB_SIZE;
/* current trb doesn't belong to this request */
- if ((priv_req->start_trb < priv_req->end_trb) &&
- (priv_ep->dequeue > priv_req->end_trb))
- goto finish;
+ if (priv_req->start_trb < priv_req->end_trb) {
+ if (priv_ep->dequeue > priv_req->end_trb)
+ goto finish;
+
+ if (priv_ep->dequeue < priv_req->start_trb)
+ goto finish;
+ }
if ((priv_req->start_trb > priv_req->end_trb) &&
(priv_ep->dequeue > priv_req->end_trb) &&