Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2798437yba; Mon, 22 Apr 2019 13:11:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqydI2Qo3+l2YEzuSGZv6xHNrI1uul7VW05U7sV8FnHEzenBXYPMvC8MXTnkaMGd9ts5+gEL X-Received: by 2002:aa7:81d0:: with SMTP id c16mr22162963pfn.132.1555963879306; Mon, 22 Apr 2019 13:11:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555963879; cv=none; d=google.com; s=arc-20160816; b=ggEWtp+INN/8h8oIzXPMsK7/d4LuDKgWx10xvAhHPb4XpG1l3LpEueMjPou+88/ePh 2Jes3w2o8Zk1VwhpYwyr5Ug7ygYD6n9swI6QWeoJ0qrm0YysvFSveWw1Lk3xRjEcBKDE Mi1L9++LDdlPheCJOPGw/ElkbWATmlTObRRlWbcM7XP7fTUtZzNwKEbOv65ZdPP/B/Cz 4TzbFOe+4+2Bldu5jYam5ul3++jCfIDyCHLxfhaRjUP/VAfxEHOdM6oMharHrj4OsXu/ qZ/COg88+1Iz1ZxwxkqCR/X5BsNQmWG6vOqgn/lK9y0wHFKxOQZkU+3WS2/POqnG7Y5u s85A== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7304rame52Jo31ubm0Vy4RkDVz2gKuD8MQmPStWAhnw=; b=gePZ1oPYEyajijZw6cpberh8MgLOs+QtP0eODF5b+3DrWoaIGbJgWEp527cc+LiIgZ naxBxbGBqmhm2nhzQjJlw2XZgW6/6uA9zqoa7KIdpa1q6YIrZosRsCEpIOE1+8rsK2A3 Ij3Z/a4bXYbTZdAxsomY4j3O8A+cB+XDWpN5rgEHS/ZUXioXuVfcb5JLoYMyMm+Emwit offVWjBgzJezYd/ShiKoV6s2gPnmWrQ5G4tKSaODJx1YfasWyg/JPCf64ca7cxE39bRr zOmh+yZUAEsQeBEK3KcYSgcKxHzuNCOtrsnUKVeb3NM1ffZfNDOCydOOg6jvz4XKp03A yCUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FEyghscj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d23si12947810pgh.448.2019.04.22.13.11.03; Mon, 22 Apr 2019 13:11:19 -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=FEyghscj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729063AbfDVTnC (ORCPT + 99 others); Mon, 22 Apr 2019 15:43:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:43506 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729036AbfDVTm7 (ORCPT ); Mon, 22 Apr 2019 15:42:59 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 610CC21738; Mon, 22 Apr 2019 19:42:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555962179; bh=tdnyn7TX3KQXrd545pwSGqc4A9p3MbBSGaY1ee9cg1Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FEyghscj3VmPHiQGDyIKWrWc7yj+ibab1dDn8TB+e5Iez3SDHMyIbnmw9X/Z5MLVU ExNO7eM8d+hoMugx1nGB3cLbAyTX6p5u+WkuseWyX3eALEj7g2CDm8jEDGMiuNO0NQ toutat+6DM/5GU66iozeFxi1Tu3Ye5xsSo1AOnRQ= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Guido Kiener , Guido Kiener , Felipe Balbi , Sasha Levin , linux-usb@vger.kernel.org Subject: [PATCH AUTOSEL 5.0 32/98] usb: gadget: net2280: Fix net2280_dequeue() Date: Mon, 22 Apr 2019 15:40:59 -0400 Message-Id: <20190422194205.10404-32-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190422194205.10404-1-sashal@kernel.org> References: <20190422194205.10404-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guido Kiener [ 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 dc6f5a78d124..d93cf4171953 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