Commit 566ccdda authored by Moiz Sonasath's avatar Moiz Sonasath Committed by Felipe Balbi

usb: dwc3: ep0: Handle requests greater than wMaxPacketSize

To allow ep0 out transfers of upto bounce buffer size
instead of maxpacketsize, use the transfer size as multiple
of ep0 maxpacket size.

Cc: stable@vger.kernel.org
Signed-off-by: default avatarMoiz Sonasath <m-sonasath@ti.com>
Signed-off-by: default avatarPartha Basak <p-basak2@ti.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 6d258a4c
...@@ -559,8 +559,12 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc, ...@@ -559,8 +559,12 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc,
length = trb->size & DWC3_TRB_SIZE_MASK; length = trb->size & DWC3_TRB_SIZE_MASK;
if (dwc->ep0_bounced) { if (dwc->ep0_bounced) {
unsigned transfer_size = ur->length;
unsigned maxp = ep0->endpoint.maxpacket;
transfer_size += (maxp - (transfer_size % maxp));
transferred = min_t(u32, ur->length, transferred = min_t(u32, ur->length,
ep0->endpoint.maxpacket - length); transfer_size - length);
memcpy(ur->buf, dwc->ep0_bounce, transferred); memcpy(ur->buf, dwc->ep0_bounce, transferred);
dwc->ep0_bounced = false; dwc->ep0_bounced = false;
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment