From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,T_DKIMWL_WL_HIGH,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2D8AC43219 for ; Thu, 2 May 2019 15:44:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8A463204FD for ; Thu, 2 May 2019 15:44:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556811873; bh=ffm1ZePdkczTXlneRZz7fsIlj9QJKLtDsTaRRetpzSk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=AOPOQQHa8KrlJ1R1iWmDZm54HxSLG+tO0rAiYfJ+KtuND+J7FeP0dnqmkuCc4aayX VyYNvBDaJRsKIZrRToCZVARosT2GIEWRyBa6LnvfDqed2GQkZXGzP3BySF5yXZQ0PF nlddsoEv8fPFjZM39Vlyp/4ltyrzjbkIglhbrbIs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727738AbfEBP01 (ORCPT ); Thu, 2 May 2019 11:26:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:43112 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726998AbfEBP01 (ORCPT ); Thu, 2 May 2019 11:26:27 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C760120B7C; Thu, 2 May 2019 15:26:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556810786; bh=ffm1ZePdkczTXlneRZz7fsIlj9QJKLtDsTaRRetpzSk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D5RQLC5ccRtMOYkPr9gKwIyvmmwBREsQ4XWF1a3Bi7IE/EFUO8+paIPp8hsTjU+06 MslcVyjCqiQ0UXosJ2480TAN22zxiu7jVh2A/jXG1c3aIWgUA9TLLylcZz/mCRIUJB hwyQ/X8ZYKZbyMnecJ2IoUjWDCq0e/oLicGo900Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alan Stern , Guido Kiener , Felipe Balbi , "Sasha Levin (Microsoft)" Subject: [PATCH 4.19 29/72] usb: gadget: net2280: Fix net2280_dequeue() Date: Thu, 2 May 2019 17:20:51 +0200 Message-Id: <20190502143335.814488479@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190502143333.437607839@linuxfoundation.org> References: <20190502143333.437607839@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org [ Upstream commit f1d3fba17cd4eeea20397f1324b7b9c69a6a935c ] 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 Signed-off-by: Guido Kiener Signed-off-by: Felipe Balbi Signed-off-by: Sasha Levin (Microsoft) --- 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 c57046b1da0e..ee872cad5270 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; } -- 2.19.1