Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp7372505yba; Thu, 2 May 2019 08:46:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqyoRx+kvMBKcxWzf35pql0WDAd/ATYd3BwHhwDe3HXtKI/36nfGEzs4CyhvKkPPBE+bih20 X-Received: by 2002:a63:e042:: with SMTP id n2mr4663809pgj.45.1556811982878; Thu, 02 May 2019 08:46:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556811982; cv=none; d=google.com; s=arc-20160816; b=f9CaGiIjWXRyR4fXyNgPBlj0j/mGCSBQZ53wrCkNwWarD0SgrnGpAnFU/0XjNTgDtC Q0ZQohzAIKPnJTxyPRFJEBDTWEzMzyC8ZjMZLLaFfZUTcdeJC/huTLs6ml6/B+yEQpDy WBA2e+G+2YPZEWpz1iM0GVusuhluwGBj7rLeE2J6XKGB2SihVp1rVbQxnYn5t/YwJ8TF BDbqjyZEt2uxE25TVMBuRSCEqYY7LFsPKV2aBKdYdLNNLn5ZXOcGYMrARISSjZyD/9mS DP86wQsA+iSfaz2SYgntKIRrfXdZYP+Dly7wXdSoBhRFpfNaSfZNW4QmwF/QFAizQQdQ 8DxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=m2QY/avHQ2oX/5Fd43vEa+jkPfgvdCklgQEZ9tiZG7o=; b=DZ+gypGvj0oG5kLXnFHVIVNHibyIUVR55w70bDtdbjCK7k4Yu3l7wNymCdwrDyv/MQ WPliJpi67F4scKzw5JfPEKp39HyhEeckM7/fhi1l7qHKo//ODeiSM9LNmCOnFUl5v41z Fax8aKJFfTu6M7JIv9s+z60vBpeBnomHwHFfgG4TzNIxhuj105gEwzA7XJIvZ50WonnK asrnV/bVsu9Ocgbk+QDneKxH7rSofpVHRSUaBYZixhlDDcSVWlKhJmENt8BpD/5DN2e9 MHoG7IZzCQsFywl5Nm5JofbFAl/wL7IVLQEODfmUlmC2p+EyNwZUqV3YKoCsud44MtyU /2WA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=D5RQLC5c; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y22si1892429pfe.141.2019.05.02.08.46.08; Thu, 02 May 2019 08:46:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=D5RQLC5c; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727747AbfEBP0b (ORCPT + 99 others); Thu, 2 May 2019 11:26:31 -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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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