From patchwork Mon Mar 18 08:18:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guido Kiener X-Patchwork-Id: 10856925 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CB6C0139A for ; Mon, 18 Mar 2019 07:25:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 973742921A for ; Mon, 18 Mar 2019 07:25:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 86B172924D; Mon, 18 Mar 2019 07:25:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 387052921A for ; Mon, 18 Mar 2019 07:25:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726844AbfCRHZD (ORCPT ); Mon, 18 Mar 2019 03:25:03 -0400 Received: from mr01.mx01.tldhost.de ([62.108.36.247]:44587 "EHLO mr01.mx01.tldhost.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726135AbfCRHZD (ORCPT ); Mon, 18 Mar 2019 03:25:03 -0400 Received: from mx01.tldhost.de (localhost [127.0.0.1]) by mx01.tldhost.de (Postfix) with ESMTP id 20D68120CB7 for ; Mon, 18 Mar 2019 08:19:51 +0100 (CET) Received: by mx01.tldhost.de (Postfix, from userid 1001) id 14F50120CDF; Mon, 18 Mar 2019 08:19:51 +0100 (CET) Received: from server12.tldhost.de (server12.tldhost.de [84.19.26.112]) by mx01.tldhost.de (Postfix) with ESMTPS id D8F7B120CB7; Mon, 18 Mar 2019 08:19:49 +0100 (CET) From: Guido Kiener To: Felipe Balbi , linux-usb@vger.kernel.org, guido.kiener@rohde-schwarz.com, Alan Stern Cc: Guido Kiener Subject: [PATCH v2 2/3] usb: gadget: net2280: Fix net2280_dequeue() Date: Mon, 18 Mar 2019 09:18:33 +0100 Message-Id: <20190318081834.4601-2-guido@kiener-muenchen.de> In-Reply-To: <20190318081834.4601-1-guido@kiener-muenchen.de> References: <20190318081834.4601-1-guido@kiener-muenchen.de> X-PPP-Message-ID: <20190318071950.6833.78588@server12.tldhost.de> X-PPP-Vhost: kiener-muenchen.de X-POWERED-BY: TLDHost.de - AV:CLEAN SPAM:OK Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. Signed-off-by: Guido Kiener Acked-by: Alan Stern --- drivers/usb/gadget/udc/net2280.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/udc/net2280.c b/drivers/usb/gadget/udc/net2280.c index e0b413e9e532..898339e5df10 100644 --- a/drivers/usb/gadget/udc/net2280.c +++ b/drivers/usb/gadget/udc/net2280.c @@ -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; }