Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: gadget: net2280: Fix net2280_dequeue()

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>

authored by

Guido Kiener and committed by
Felipe Balbi
f1d3fba1 9d6a54c1

+2 -2
+2 -2
drivers/usb/gadget/udc/net2280.c
··· 1273 1273 break; 1274 1274 } 1275 1275 if (&req->req != _req) { 1276 + ep->stopped = stopped; 1276 1277 spin_unlock_irqrestore(&ep->dev->lock, flags); 1277 - dev_err(&ep->dev->pdev->dev, "%s: Request mismatch\n", 1278 - __func__); 1278 + ep_dbg(ep->dev, "%s: Request mismatch\n", __func__); 1279 1279 return -EINVAL; 1280 1280 } 1281 1281