Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit f5313c8

Browse files
Thinh Nguyengregkh
authored andcommitted
usb: dwc3: gadget: Remove dwc3_request->needs_extra_trb
Now that we track TRBs base on request->num_trbs on reclaim, we don't need to save the dwc3_request->needs_extra_trb check. Remove it. Signed-off-by: Thinh Nguyen <[email protected]> Link: https://lore.kernel.org/r/08dd88a3308ac7894267c52340eaf0e1564bbf36.1731545781.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 6144062 commit f5313c8

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

drivers/usb/dwc3/core.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -949,8 +949,6 @@ struct dwc3_hwparams {
949949
* @trb: pointer to struct dwc3_trb
950950
* @trb_dma: DMA address of @trb
951951
* @num_trbs: number of TRBs used by this request
952-
* @needs_extra_trb: true when request needs one extra TRB (either due to ZLP
953-
* or unaligned OUT)
954952
* @direction: IN or OUT direction flag
955953
* @mapped: true when request has been dma-mapped
956954
*/
@@ -979,7 +977,6 @@ struct dwc3_request {
979977

980978
unsigned int num_trbs;
981979

982-
unsigned int needs_extra_trb:1;
983980
unsigned int direction:1;
984981
unsigned int mapped:1;
985982
};

drivers/usb/dwc3/gadget.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ static void dwc3_gadget_del_and_unmap_request(struct dwc3_ep *dep,
197197

198198
list_del(&req->list);
199199
req->remaining = 0;
200-
req->needs_extra_trb = false;
201200
req->num_trbs = 0;
202201

203202
if (req->request.status == -EINPROGRESS)
@@ -1440,22 +1439,23 @@ static int dwc3_prepare_last_sg(struct dwc3_ep *dep,
14401439
unsigned int maxp = usb_endpoint_maxp(dep->endpoint.desc);
14411440
unsigned int rem = req->request.length % maxp;
14421441
unsigned int num_trbs = 1;
1442+
bool needs_extra_trb;
14431443

14441444
if (dwc3_needs_extra_trb(dep, req))
14451445
num_trbs++;
14461446

14471447
if (dwc3_calc_trbs_left(dep) < num_trbs)
14481448
return 0;
14491449

1450-
req->needs_extra_trb = num_trbs > 1;
1450+
needs_extra_trb = num_trbs > 1;
14511451

14521452
/* Prepare a normal TRB */
14531453
if (req->direction || req->request.length)
14541454
dwc3_prepare_one_trb(dep, req, entry_length,
1455-
req->needs_extra_trb, node, false, false);
1455+
needs_extra_trb, node, false, false);
14561456

14571457
/* Prepare extra TRBs for ZLP and MPS OUT transfer alignment */
1458-
if ((!req->direction && !req->request.length) || req->needs_extra_trb)
1458+
if ((!req->direction && !req->request.length) || needs_extra_trb)
14591459
dwc3_prepare_one_trb(dep, req,
14601460
req->direction ? 0 : maxp - rem,
14611461
false, 1, true, false);

0 commit comments

Comments
 (0)