1 From 4cf28811e6cf47b324cf2b17e9e246bf63fd38ee Mon Sep 17 00:00:00 2001
2 From: Guido Kiener <guido@kiener-muenchen.de>
3 Date: Mon, 18 Mar 2019 09:18:33 +0100
4 Subject: usb: gadget: net2280: Fix net2280_dequeue()
6 [ Upstream commit f1d3fba17cd4eeea20397f1324b7b9c69a6a935c ]
8 When a request must be dequeued with net2280_dequeue() e.g. due
9 to a device clear action and the same request is finished by the
10 function scan_dma_completions() then the function net2280_dequeue()
11 does not find the request in the following search loop and
12 returns the error -EINVAL without restoring the status ep->stopped.
13 Thus the endpoint keeps blocked and does not receive any data
15 This fix restores the status and does not issue an error message.
17 Acked-by: Alan Stern <stern@rowland.harvard.edu>
18 Signed-off-by: Guido Kiener <guido.kiener@rohde-schwarz.com>
19 Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
20 Signed-off-by: Sasha Levin (Microsoft) <sashal@kernel.org>
22 drivers/usb/gadget/udc/net2280.c | 4 ++--
23 1 file changed, 2 insertions(+), 2 deletions(-)
25 diff --git a/drivers/usb/gadget/udc/net2280.c b/drivers/usb/gadget/udc/net2280.c
26 index fc94a09e2a5a..3a8d056a5d16 100644
27 --- a/drivers/usb/gadget/udc/net2280.c
28 +++ b/drivers/usb/gadget/udc/net2280.c
29 @@ -1270,9 +1270,9 @@ static int net2280_dequeue(struct usb_ep *_ep, struct usb_request *_req)
32 if (&req->req != _req) {
33 + ep->stopped = stopped;
34 spin_unlock_irqrestore(&ep->dev->lock, flags);
35 - dev_err(&ep->dev->pdev->dev, "%s: Request mismatch\n",
37 + ep_dbg(ep->dev, "%s: Request mismatch\n", __func__);