Skip to content

Commit 24fdaee

Browse files
author
Peter Chen
committed
usb: cdns3: gadget: clear trb->length as zero after preparing every trb
It clears trb->length as zero before preparing td, but if scatter buffer is used for td, there are several trbs within td, it needs to clear every trb->length as zero, otherwise, the default value for trb->length may not be zero after it begins to use the second round of trb rings. Fixes: abc6b57 ("usb: cdns3: gadget: using correct sg operations") Signed-off-by: Peter Chen <peter.chen@nxp.com>
1 parent 6703052 commit 24fdaee

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/usb/cdns3/gadget.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,6 +1260,7 @@ static int cdns3_ep_run_transfer(struct cdns3_endpoint *priv_ep,
12601260
priv_req->end_trb = priv_ep->enqueue;
12611261
cdns3_ep_inc_enq(priv_ep);
12621262
trb = priv_ep->trb_pool + priv_ep->enqueue;
1263+
trb->length = 0;
12631264
} while (sg_iter < num_trb);
12641265

12651266
trb = priv_req->trb;

0 commit comments

Comments
 (0)