]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
usb: gadget: net2280: Fix net2280_dequeue()
authorGuido Kiener <guido@kiener-muenchen.de>
Mon, 18 Mar 2019 08:18:33 +0000 (09:18 +0100)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Wed, 20 Mar 2019 06:50:19 +0000 (08:50 +0200)
When a request must be dequeued with net2280_dequeue() e.g. due
to a device clear action and the same request is finished by the
function scan_dma_completions() then the function net2280_dequeue()
does not find the request in the following search loop and
returns the error -EINVAL without restoring the status ep->stopped.
Thus the endpoint keeps blocked and does not receive any data
anymore.
This fix restores the status and does not issue an error message.

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Guido Kiener <guido.kiener@rohde-schwarz.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/gadget/udc/net2280.c

index e0b413e9e532479c5a2172f236717218dc488c0b..898339e5df10d83d211942609a9bd695f199e787 100644 (file)
@@ -1273,9 +1273,9 @@ static int net2280_dequeue(struct usb_ep *_ep, struct usb_request *_req)
                        break;
        }
        if (&req->req != _req) {
+               ep->stopped = stopped;
                spin_unlock_irqrestore(&ep->dev->lock, flags);
-               dev_err(&ep->dev->pdev->dev, "%s: Request mismatch\n",
-                                                               __func__);
+               ep_dbg(ep->dev, "%s: Request mismatch\n", __func__);
                return -EINVAL;
        }