[PATCH 1/2] usb: cdns3: gadget: clear trb->length as zero after preparing every trb

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Peter Chen <peter.chen@xxxxxxx>

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: abc6b579048e ("usb: cdns3: gadget: using correct sg operations")
Signed-off-by: Peter Chen <peter.chen@xxxxxxx>
---
 drivers/usb/cdns3/gadget.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c
index 365f30fb1159..0aa85cc07ff1 100644
--- a/drivers/usb/cdns3/gadget.c
+++ b/drivers/usb/cdns3/gadget.c
@@ -1260,6 +1260,7 @@ static int cdns3_ep_run_transfer(struct cdns3_endpoint *priv_ep,
 		priv_req->end_trb = priv_ep->enqueue;
 		cdns3_ep_inc_enq(priv_ep);
 		trb = priv_ep->trb_pool + priv_ep->enqueue;
+		trb->length = 0;
 	} while (sg_iter < num_trb);
 
 	trb = priv_req->trb;
-- 
2.17.1




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux