Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 354603
b: refs/heads/master
c: 7efea86
h: refs/heads/master
i:
  354601: fe84c23
  354599: a1c3fc8
v: v3
  • Loading branch information
Pratyush Anand authored and Felipe Balbi committed Jan 18, 2013
1 parent 0eddbc8 commit 530cd28
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2b758350af19db9a5c98241cf222c2e211d7a912
refs/heads/master: 7efea86c2868b8fd9df65e589e33aebe498ce21d
2 changes: 0 additions & 2 deletions trunk/drivers/usb/dwc3/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,6 @@ struct dwc3_event_buffer {
* @number: endpoint number (1 - 15)
* @type: set to bmAttributes & USB_ENDPOINT_XFERTYPE_MASK
* @resource_index: Resource transfer index
* @current_uf: Current uf received through last event parameter
* @interval: the intervall on which the ISOC transfer is started
* @name: a human readable name e.g. ep1out-bulk
* @direction: true for TX, false for RX
Expand Down Expand Up @@ -441,7 +440,6 @@ struct dwc3_ep {
u8 number;
u8 type;
u8 resource_index;
u16 current_uf;
u32 interval;

char name[20];
Expand Down
36 changes: 24 additions & 12 deletions trunk/drivers/usb/dwc3/gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -1115,16 +1115,6 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req)
dep->name);
}

/*
* 3. Missed ISOC Handling. We need to start isoc transfer on the saved
* uframe number.
*/
if (usb_endpoint_xfer_isoc(dep->endpoint.desc) &&
(dep->flags & DWC3_EP_MISSED_ISOC)) {
__dwc3_gadget_start_isoc(dwc, dep, dep->current_uf);
dep->flags &= ~DWC3_EP_MISSED_ISOC;
}

return 0;
}

Expand Down Expand Up @@ -1686,14 +1676,29 @@ static int dwc3_cleanup_done_reqs(struct dwc3 *dwc, struct dwc3_ep *dep,
if (trb_status == DWC3_TRBSTS_MISSED_ISOC) {
dev_dbg(dwc->dev, "incomplete IN transfer %s\n",
dep->name);
dep->current_uf = event->parameters &
~(dep->interval - 1);
/*
* If missed isoc occurred and there is
* no request queued then issue END
* TRANSFER, so that core generates
* next xfernotready and we will issue
* a fresh START TRANSFER.
* If there are still queued request
* then wait, do not issue either END
* or UPDATE TRANSFER, just attach next
* request in request_list during
* giveback.If any future queued request
* is successfully transferred then we
* will issue UPDATE TRANSFER for all
* request in the request_list.
*/
dep->flags |= DWC3_EP_MISSED_ISOC;
} else {
dev_err(dwc->dev, "incomplete IN transfer %s\n",
dep->name);
status = -ECONNRESET;
}
} else {
dep->flags &= ~DWC3_EP_MISSED_ISOC;
}
} else {
if (count && (event->status & DEPEVT_STATUS_SHORT))
Expand All @@ -1720,6 +1725,13 @@ static int dwc3_cleanup_done_reqs(struct dwc3 *dwc, struct dwc3_ep *dep,
break;
} while (1);

if (list_empty(&dep->req_queued) &&
(dep->flags & DWC3_EP_MISSED_ISOC)) {
dwc3_stop_active_transfer(dwc, dep->number);
dep->flags &= ~DWC3_EP_MISSED_ISOC;
return 1;
}

if ((event->status & DEPEVT_STATUS_IOC) &&
(trb->ctrl & DWC3_TRB_CTRL_IOC))
return 0;
Expand Down

0 comments on commit 530cd28

Please sign in to comment.