Commit 9bd1b9e4762990d37145e01d0dacbc3aad2fc9b8
Committed by
Sekhar Nori
1 parent
6d0853ef48
Exists in
ti-lsk-linux-4.1.y
and in
5 other branches
usb: dwc3: gadget: use update transfer command
If we get a Xfer Not Ready event with reason "Transfer Active" it means endpoint is still transferring data and we can use that to issue update transfer for this particular endpoint in case we have pending requests in our queue. Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Showing 1 changed file with 5 additions and 4 deletions Side-by-side Diff
drivers/usb/dwc3/gadget.c
... | ... | @@ -2107,15 +2107,16 @@ |
2107 | 2107 | if (usb_endpoint_xfer_isoc(dep->endpoint.desc)) { |
2108 | 2108 | dwc3_gadget_start_isoc(dwc, dep, event); |
2109 | 2109 | } else { |
2110 | + int active; | |
2110 | 2111 | int ret; |
2111 | 2112 | |
2113 | + active = event->status & DEPEVT_STATUS_TRANSFER_ACTIVE; | |
2114 | + | |
2112 | 2115 | dwc3_trace(trace_dwc3_gadget, "%s: reason %s", |
2113 | - dep->name, event->status & | |
2114 | - DEPEVT_STATUS_TRANSFER_ACTIVE | |
2115 | - ? "Transfer Active" | |
2116 | + dep->name, active ? "Transfer Active" | |
2116 | 2117 | : "Transfer Not Active"); |
2117 | 2118 | |
2118 | - ret = __dwc3_gadget_kick_transfer(dep, 0, 1); | |
2119 | + ret = __dwc3_gadget_kick_transfer(dep, 0, !active); | |
2119 | 2120 | if (!ret || ret == -EBUSY) |
2120 | 2121 | return; |
2121 | 2122 |