Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6028081imu; Mon, 21 Jan 2019 01:48:03 -0800 (PST) X-Google-Smtp-Source: ALg8bN7r+OEjIY2xC5zn2GP+bYYpjGQva/3hGeI2Ro1sQDKtytCRG5hHpjRuSkgXDhYdbz2wDE1m X-Received: by 2002:a63:5621:: with SMTP id k33mr27703113pgb.395.1548064083806; Mon, 21 Jan 2019 01:48:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548064083; cv=none; d=google.com; s=arc-20160816; b=XgLwofd3QoKDtkic8iQbmfO8k695pTGRlSF+1+Yx088FgWaNAuo2UCU4RUQtMBs3HE gFEJAsjGrDoQ5yO0x4wc7dLXlBRRYQVYLSS+91zbHMW5oYzGSficLmupCvAaGpKtAAr2 OYsn8OoepPP9rCWrecPCWXZBmAljO6TM140DYuw19Mn6AKlf5ZwqvoiSStRyfXJGjxQG JdwqtfPxvACiLV/dMYKfMOO/+3NS1rroflRxaMevCdSqeN8kG8BY9t+oi4taDwvVkyZI moYJ/6YhQi++Ndmv8srm6C9AnfuxCdU0jLoKgBbfmSA0aZYc7lWqso+PlQ2AYtrcsb+l b13g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=u3l/WID9BrvBTtMeXSOnDwhxb1K1NdzeEcvCpxfw7+k=; b=V5fTySv93vjNcM2dkRBxXxY8VMC4OoYmscHTn6cM0+lx5oHRZIpnVoeXEt+BoVmON0 EIiQl6bjESYu0/atd/tD4khFk87AbwIy2piCu0q2wSrUfendR1/8JIANXekYUUGq1Z0i KdtW2XOJZ+/vh/JF/jC0FefYc++kVgk9KWA9N9jbcuT7Rq+VVR7cqetGf6VnJZJzVcgG 3iDhfDGeN3GIiiu6P/KB9C46B/G4iVjeebv8YQpQb2rcs/TI0XHzV1g7AI+QRQp735rv nbrRWV3CdY3SwJQ59JfFbrspfhCZ0gxd+WJH/EDKQsbbUVeKQJnUJBkLvHhzRAGpcJJy JFGg== ARC-Authentication-Results: i=1; mx.google.com; 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 s71si11886528pfk.105.2019.01.21.01.47.48; Mon, 21 Jan 2019 01:48:03 -0800 (PST) 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; 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 S1728011AbfAUJqp (ORCPT + 99 others); Mon, 21 Jan 2019 04:46:45 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:56764 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726133AbfAUJqp (ORCPT ); Mon, 21 Jan 2019 04:46:45 -0500 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id C455CCDF45D16E566276; Mon, 21 Jan 2019 10:00:38 +0800 (CST) Received: from dessert.huawei.com (10.69.192.158) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.408.0; Mon, 21 Jan 2019 10:00:29 +0800 From: Zeng Tao To: CC: Zeng Tao , Felipe Balbi , "Greg Kroah-Hartman" , , Subject: [PATCH] usb: dwc3: gadget: issue a stop command for ISOC endpoint Date: Mon, 21 Jan 2019 18:02:56 +0800 Message-ID: <1548064976-30196-1-git-send-email-prime.zeng@hisilicon.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.158] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For ISOC transfers, if there is no available data for a period, we need to stop the transfer by issue a stop command, otherwise, all the upcoming transfers will started by update transfer command, and will be dropped with MISS ISOC errors. Signed-off-by: Zeng Tao --- drivers/usb/dwc3/gadget.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index e18c2a2..58e71ba 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2500,6 +2500,10 @@ static void dwc3_gadget_endpoint_transfer_in_progress(struct dwc3_ep *dep, stop = true; } + if (list_empty(&dep->started_list) && + (usb_endpoint_xfer_isoc(dep->endpoint.desc))) + stop = true; + dwc3_gadget_ep_cleanup_completed_requests(dep, event, status); if (stop) { -- 2.7.4