usb: dwc3: gadget: remove allocated/queued request tracking

That has never proven useful in any way. Just remove it.

Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
This commit is contained in:
Felipe Balbi 2018-03-26 16:09:00 +03:00
parent 66f5dd5a03
commit 0bd0f6d201
3 changed files with 8 additions and 24 deletions

View File

@ -639,8 +639,6 @@ struct dwc3_event_buffer {
* @resource_index: Resource transfer index * @resource_index: Resource transfer index
* @frame_number: set to the frame number we want this transfer to start (ISOC) * @frame_number: set to the frame number we want this transfer to start (ISOC)
* @interval: the interval on which the ISOC transfer is started * @interval: the interval on which the ISOC transfer is started
* @allocated_requests: number of requests allocated
* @queued_requests: number of requests queued for transfer
* @name: a human readable name e.g. ep1out-bulk * @name: a human readable name e.g. ep1out-bulk
* @direction: true for TX, false for RX * @direction: true for TX, false for RX
* @stream_capable: true when streams are enabled * @stream_capable: true when streams are enabled
@ -688,8 +686,6 @@ struct dwc3_ep {
u8 number; u8 number;
u8 type; u8 type;
u8 resource_index; u8 resource_index;
u32 allocated_requests;
u32 queued_requests;
u32 frame_number; u32 frame_number;
u32 interval; u32 interval;

View File

@ -840,7 +840,7 @@ static int dwc3_gadget_ep_disable(struct usb_ep *ep)
} }
static struct usb_request *dwc3_gadget_ep_alloc_request(struct usb_ep *ep, static struct usb_request *dwc3_gadget_ep_alloc_request(struct usb_ep *ep,
gfp_t gfp_flags) gfp_t gfp_flags)
{ {
struct dwc3_request *req; struct dwc3_request *req;
struct dwc3_ep *dep = to_dwc3_ep(ep); struct dwc3_ep *dep = to_dwc3_ep(ep);
@ -852,8 +852,6 @@ static struct usb_request *dwc3_gadget_ep_alloc_request(struct usb_ep *ep,
req->epnum = dep->number; req->epnum = dep->number;
req->dep = dep; req->dep = dep;
dep->allocated_requests++;
trace_dwc3_alloc_request(req); trace_dwc3_alloc_request(req);
return &req->request; return &req->request;
@ -863,9 +861,7 @@ static void dwc3_gadget_ep_free_request(struct usb_ep *ep,
struct usb_request *request) struct usb_request *request)
{ {
struct dwc3_request *req = to_dwc3_request(request); struct dwc3_request *req = to_dwc3_request(request);
struct dwc3_ep *dep = to_dwc3_ep(ep);
dep->allocated_requests--;
trace_dwc3_free_request(req); trace_dwc3_free_request(req);
kfree(req); kfree(req);
} }
@ -1005,7 +1001,6 @@ static void dwc3_prepare_one_trb(struct dwc3_ep *dep,
dwc3_gadget_move_started_request(req); dwc3_gadget_move_started_request(req);
req->trb = trb; req->trb = trb;
req->trb_dma = dwc3_trb_dma_offset(dep, trb); req->trb_dma = dwc3_trb_dma_offset(dep, trb);
dep->queued_requests++;
} }
__dwc3_prepare_one_trb(dep, trb, dma, length, chain, node, __dwc3_prepare_one_trb(dep, trb, dma, length, chain, node,
@ -1258,7 +1253,6 @@ static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep)
*/ */
if (req->trb) if (req->trb)
memset(req->trb, 0, sizeof(struct dwc3_trb)); memset(req->trb, 0, sizeof(struct dwc3_trb));
dep->queued_requests--;
dwc3_gadget_del_and_unmap_request(dep, req, ret); dwc3_gadget_del_and_unmap_request(dep, req, ret);
return ret; return ret;
} }
@ -1488,7 +1482,7 @@ static int dwc3_gadget_ep_dequeue(struct usb_ep *ep,
out1: out1:
/* giveback the request */ /* giveback the request */
dep->queued_requests--;
dwc3_gadget_giveback(dep, req, -ECONNRESET); dwc3_gadget_giveback(dep, req, -ECONNRESET);
out0: out0:
@ -2248,7 +2242,7 @@ static void dwc3_gadget_free_endpoints(struct dwc3 *dwc)
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
static int dwc3_gadget_ep_reclaim_completed_trbs(struct dwc3 *dwc, static int dwc3_gadget_ep_reclaim_completed_trb(struct dwc3 *dwc,
struct dwc3_ep *dep, struct dwc3_request *req, struct dwc3_ep *dep, struct dwc3_request *req,
struct dwc3_trb *trb, const struct dwc3_event_depevt *event, struct dwc3_trb *trb, const struct dwc3_event_depevt *event,
int status, int chain) int status, int chain)
@ -2259,9 +2253,6 @@ static int dwc3_gadget_ep_reclaim_completed_trbs(struct dwc3 *dwc,
dwc3_ep_inc_deq(dep); dwc3_ep_inc_deq(dep);
if (req->trb == trb)
dep->queued_requests--;
trace_dwc3_complete_trb(dep, trb); trace_dwc3_complete_trb(dep, trb);
/* /*
@ -2366,7 +2357,7 @@ static int dwc3_gadget_ep_cleanup_completed_requests(struct dwc3 *dwc,
req->sg = sg_next(s); req->sg = sg_next(s);
req->num_pending_sgs--; req->num_pending_sgs--;
ret = dwc3_gadget_ep_reclaim_completed_trbs(dwc, ret = dwc3_gadget_ep_reclaim_completed_trb(dwc,
dep, req, trb, event, status, dep, req, trb, event, status,
chain); chain);
if (ret) if (ret)
@ -2374,13 +2365,13 @@ static int dwc3_gadget_ep_cleanup_completed_requests(struct dwc3 *dwc,
} }
} else { } else {
trb = &dep->trb_pool[dep->trb_dequeue]; trb = &dep->trb_pool[dep->trb_dequeue];
ret = dwc3_gadget_ep_reclaim_completed_trbs(dwc, dep, ret = dwc3_gadget_ep_reclaim_completed_trb(dwc, dep,
req, trb, event, status, chain); req, trb, event, status, chain);
} }
if (req->unaligned || req->zero) { if (req->unaligned || req->zero) {
trb = &dep->trb_pool[dep->trb_dequeue]; trb = &dep->trb_pool[dep->trb_dequeue];
ret = dwc3_gadget_ep_reclaim_completed_trbs(dwc, dep, ret = dwc3_gadget_ep_reclaim_completed_trb(dwc, dep,
req, trb, event, status, false); req, trb, event, status, false);
req->unaligned = false; req->unaligned = false;
req->zero = false; req->zero = false;

View File

@ -230,17 +230,14 @@ DECLARE_EVENT_CLASS(dwc3_log_trb,
TP_fast_assign( TP_fast_assign(
__assign_str(name, dep->name); __assign_str(name, dep->name);
__entry->trb = trb; __entry->trb = trb;
__entry->allocated = dep->allocated_requests;
__entry->queued = dep->queued_requests;
__entry->bpl = trb->bpl; __entry->bpl = trb->bpl;
__entry->bph = trb->bph; __entry->bph = trb->bph;
__entry->size = trb->size; __entry->size = trb->size;
__entry->ctrl = trb->ctrl; __entry->ctrl = trb->ctrl;
__entry->type = usb_endpoint_type(dep->endpoint.desc); __entry->type = usb_endpoint_type(dep->endpoint.desc);
), ),
TP_printk("%s: %d/%d trb %p buf %08x%08x size %s%d ctrl %08x (%c%c%c%c:%c%c:%s)", TP_printk("%s: trb %p buf %08x%08x size %s%d ctrl %08x (%c%c%c%c:%c%c:%s)",
__get_str(name), __entry->queued, __entry->allocated, __get_str(name), __entry->trb, __entry->bph, __entry->bpl,
__entry->trb, __entry->bph, __entry->bpl,
({char *s; ({char *s;
int pcm = ((__entry->size >> 24) & 3) + 1; int pcm = ((__entry->size >> 24) & 3) + 1;
switch (__entry->type) { switch (__entry->type) {