From patchwork Mon Jan 21 10:02:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zeng Tao X-Patchwork-Id: 156192 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp6180411jaa; Mon, 21 Jan 2019 01:46:47 -0800 (PST) X-Google-Smtp-Source: ALg8bN7ipVQVsif2yGLDGGx0k0oOPC5FUZMHVpJrymLXJMbeE7ajzs8idSnyw7dS1YbJeJSqIZP6 X-Received: by 2002:a17:902:5a5:: with SMTP id f34mr29547831plf.161.1548064006965; Mon, 21 Jan 2019 01:46:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548064006; cv=none; d=google.com; s=arc-20160816; b=Kk1u4x2ZqcqiIuT+QS0B6/pCmszma+OqOtm+k5sl1KVwjKdrMPculmKg8BM984xxLS YRTzbc/FBcNgiy1gcg6KJJBx8OLHaba7MEryvQRqbLocqUKAf/Xh4+5n9t9TbObpPP2Z gGVWYMzZEnsTY2b0Ft8ouWyguKCTKFW7BuF1oZh8wHcXiwQvHIeX5PJsBTAeYg1MyBzm qrB/IT1VVyK99yh/vtOUGaMS9c3R86iaguZe+aCnmQdCCovJDScK+JkjYhXLMVSA5vXO yU/vljPe6YpjCHmDpMgDLri3lJz6QQYN6rf4hZ2pNNeCu/cKtAxKb5U5zfeEAbO2k95V z96A== 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=dYh0YGe1l5x4mDt2864nyUZqxMF/v98KcToUhcWCAHyBXKIIK/5DcWGDhMDVldMuGz 8nJLsePeEC7CyM1po2iz9Fz5IdGgWP37UcCBQjZ8a3uj5t41+p/PC/e2h6ktpyQ2I1S2 f72bSDMsI/EdgMolGoSusyy8F02FoiBPF7CO9stww959VoKOC2YRi15UbAGgqgGQOn4K KZsJTzbrfazte2XYWrhTLfrm10V9SJWVCG+o5G5+CLtEPNKEvAj4kUvTs8QOU+lcFLyA DM3HwJ48hUxmxjIzkb8yX+AE3S6ZD2qhu0w/1PTtHHkSmmmAn7MJru/iEwPJGMfBi7ET qWDw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-usb-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 l3si7177659pld.229.2019.01.21.01.46.46; Mon, 21 Jan 2019 01:46:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-usb-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-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727814AbfAUJqp (ORCPT + 5 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 X-Originating-IP: [10.69.192.158] X-CFilter-Loop: Reflected Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@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(+) -- 2.7.4 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) {