Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 265125
b: refs/heads/master
c: daec765
h: refs/heads/master
i:
  265123: 2282f67
v: v3
  • Loading branch information
Neil Zhang authored and Felipe Balbi committed Oct 13, 2011
1 parent 4313f3c commit 459a099
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 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: 046b07ac0458fba8c5ca8d9ee04658c02066ee03
refs/heads/master: daec765da767e4a6a30e1298862b28f2cae9a73f
27 changes: 26 additions & 1 deletion trunk/drivers/usb/gadget/mv_udc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ static int process_ep_req(struct mv_udc *udc, int index,
int i, direction;
int retval = 0;
u32 errors;
u32 bit_pos;

curr_dqh = &udc->ep_dqh[index];
direction = index % 2;
Expand All @@ -155,10 +156,20 @@ static int process_ep_req(struct mv_udc *udc, int index,

errors = curr_dtd->size_ioc_sts & DTD_ERROR_MASK;
if (!errors) {
remaining_length +=
remaining_length =
(curr_dtd->size_ioc_sts & DTD_PACKET_SIZE)
>> DTD_LENGTH_BIT_POS;
actual -= remaining_length;

if (remaining_length) {
if (direction) {
dev_dbg(&udc->dev->dev,
"TX dTD remains data\n");
retval = -EPROTO;
break;
} else
break;
}
} else {
dev_info(&udc->dev->dev,
"complete_tr error: ep=%d %s: error = 0x%x\n",
Expand All @@ -180,6 +191,20 @@ static int process_ep_req(struct mv_udc *udc, int index,
if (retval)
return retval;

if (direction == EP_DIR_OUT)
bit_pos = 1 << curr_req->ep->ep_num;
else
bit_pos = 1 << (16 + curr_req->ep->ep_num);

while ((curr_dqh->curr_dtd_ptr == curr_dtd->td_dma)) {
if (curr_dtd->dtd_next == EP_QUEUE_HEAD_NEXT_TERMINATE) {
while (readl(&udc->op_regs->epstatus) & bit_pos)
udelay(1);
break;
}
udelay(1);
}

curr_req->req.actual = actual;

return 0;
Expand Down

0 comments on commit 459a099

Please sign in to comment.