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: "Zengtao (B)" X-Patchwork-Id: 10773469 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B01BE1580 for ; Mon, 21 Jan 2019 09:46:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9CCFF299B7 for ; Mon, 21 Jan 2019 09:46:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8FF25299C6; Mon, 21 Jan 2019 09:46:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C423299B7 for ; Mon, 21 Jan 2019 09:46:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727814AbfAUJqp (ORCPT ); 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 X-Virus-Scanned: ClamAV using ClamSMTP 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) {