Ignore:
Timestamp:
Apr 18, 2017, 8:47:31 AM (3 months ago)
Author:
brainslayer
Message:

update kernels

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/linux/universal/linux-4.4/drivers/usb/dwc3/gadget.c

    r31278 r31884  
    249249{
    250250        struct dwc3                     *dwc = dep->dwc;
     251        unsigned int                    unmap_after_complete = false;
    251252        int                             i;
    252253
     
    273274                req->request.status = status;
    274275
    275         if (dwc->ep0_bounced && dep->number <= 1)
     276        /*
     277         * NOTICE we don't want to unmap before calling ->complete() if we're
     278         * dealing with a bounced ep0 request. If we unmap it here, we would end
     279         * up overwritting the contents of req->buf and this could confuse the
     280         * gadget driver.
     281         */
     282        if (dwc->ep0_bounced && dep->number <= 1) {
    276283                dwc->ep0_bounced = false;
    277 
    278         usb_gadget_unmap_request(&dwc->gadget, &req->request,
    279                         req->direction);
     284                unmap_after_complete = true;
     285        } else {
     286                usb_gadget_unmap_request(&dwc->gadget,
     287                                &req->request, req->direction);
     288        }
    280289
    281290        dev_dbg(dwc->dev, "request %p from %s completed %d/%d ===> %d\n",
     
    287296        usb_gadget_giveback_request(&dep->endpoint, &req->request);
    288297        spin_lock(&dwc->lock);
     298
     299        if (unmap_after_complete)
     300                usb_gadget_unmap_request(&dwc->gadget,
     301                                &req->request, req->direction);
    289302}
    290303
Note: See TracChangeset for help on using the changeset viewer.