From patchwork Thu Dec 20 20:53:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zengtao (B)" X-Patchwork-Id: 10738837 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 5D479746 for ; Thu, 20 Dec 2018 12:51:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D19428790 for ; Thu, 20 Dec 2018 12:51:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4113028824; Thu, 20 Dec 2018 12:51:01 +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=-6.0 required=2.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, 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 815E72881A for ; Thu, 20 Dec 2018 12:51:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731397AbeLTMuy (ORCPT ); Thu, 20 Dec 2018 07:50:54 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:16615 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728966AbeLTMuy (ORCPT ); Thu, 20 Dec 2018 07:50:54 -0500 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id AB3072A9331DF; Thu, 20 Dec 2018 20:50:49 +0800 (CST) Received: from dessert.huawei.com (10.69.192.158) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.408.0; Thu, 20 Dec 2018 20:50:41 +0800 From: Zeng Tao To: CC: Zeng Tao , Felipe Balbi , "Greg Kroah-Hartman" , , Subject: [PATCH] usb: dwc3: gadget: don't remove the request if bus-expired Date: Fri, 21 Dec 2018 04:53:50 +0800 Message-ID: <1545339230-10520-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 We have already returned EAGAIN for bus-expiry, and it's designed to start with a future Frame number and start the transfer again. So we should not remove the request for that case. Signed-off-by: Zeng Tao --- drivers/usb/dwc3/gadget.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 2ecde30..16a6e3c 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1250,7 +1250,7 @@ static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep) } ret = dwc3_send_gadget_ep_cmd(dep, cmd, ¶ms); - if (ret < 0) { + if (ret < 0 && ret != -EAGAIN) { /* * FIXME we need to iterate over the list of requests * here and stop, unmap, free and del each of the linked @@ -1259,10 +1259,9 @@ static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep) if (req->trb) memset(req->trb, 0, sizeof(struct dwc3_trb)); dwc3_gadget_del_and_unmap_request(dep, req, ret); - return ret; } - return 0; + return ret; } static int __dwc3_gadget_get_frame(struct dwc3 *dwc)