Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280815
b: refs/heads/master
c: 9cc9bcd
h: refs/heads/master
i:
  280813: ec77bde
  280811: 10a6349
  280807: 7ca663b
  280799: fbecc98
v: v3
  • Loading branch information
Felipe Balbi committed Dec 12, 2011
1 parent a016c57 commit 6c5c3f0
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0b9fe32deece53c9bc6d1e6d17a85ef1eb2e294b
refs/heads/master: 9cc9bcd5b3e8efa45accf2ccb59f13c8de85a0ce
35 changes: 35 additions & 0 deletions trunk/drivers/usb/dwc3/ep0.c
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,41 @@ static void dwc3_ep0_do_control_status(struct dwc3 *dwc,
static void dwc3_ep0_xfernotready(struct dwc3 *dwc,
const struct dwc3_event_depevt *event)
{
/*
* This part is very tricky: If we has just handled
* XferNotReady(Setup) and we're now expecting a
* XferComplete but, instead, we receive another
* XferNotReady(Setup), we should STALL and restart
* the state machine.
*
* In all other cases, we just continue waiting
* for the XferComplete event.
*
* We are a little bit unsafe here because we're
* not trying to ensure that last event was, indeed,
* XferNotReady(Setup).
*
* Still, we don't expect any condition where that
* should happen and, even if it does, it would be
* another error condition.
*/
if (dwc->ep0_next_event == DWC3_EP0_COMPLETE) {
switch (event->status) {
case DEPEVT_STATUS_CONTROL_SETUP:
dev_vdbg(dwc->dev, "Unexpected XferNotReady(Setup)\n");
dwc3_ep0_stall_and_restart(dwc);
break;
case DEPEVT_STATUS_CONTROL_DATA:
/* FALLTHROUGH */
case DEPEVT_STATUS_CONTROL_STATUS:
/* FALLTHROUGH */
default:
dev_vdbg(dwc->dev, "waiting for XferComplete\n");
}

return;
}

switch (event->status) {
case DEPEVT_STATUS_CONTROL_SETUP:
dev_vdbg(dwc->dev, "Control Setup\n");
Expand Down

0 comments on commit 6c5c3f0

Please sign in to comment.