]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.4/usb-gadget-net2280-fix-net2280_dequeue.patch
4.4-stable patches
[thirdparty/kernel/stable-queue.git] / queue-4.4 / usb-gadget-net2280-fix-net2280_dequeue.patch
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()
5
6 [ Upstream commit f1d3fba17cd4eeea20397f1324b7b9c69a6a935c ]
7
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
14 anymore.
15 This fix restores the status and does not issue an error message.
16
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>
21 ---
22 drivers/usb/gadget/udc/net2280.c | 4 ++--
23 1 file changed, 2 insertions(+), 2 deletions(-)
24
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)
30 break;
31 }
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",
36 - __func__);
37 + ep_dbg(ep->dev, "%s: Request mismatch\n", __func__);
38 return -EINVAL;
39 }
40
41 --
42 2.19.1
43