Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1222572imu; Thu, 20 Dec 2018 12:19:09 -0800 (PST) X-Google-Smtp-Source: AFSGD/URi1i3SFRKg4MDTPbeUJ3I8aGJYuXbGA+CUcxQHjOzrZzxG/J6kxJHqAtPU2lzmMKywjyB X-Received: by 2002:a62:cf02:: with SMTP id b2mr26660613pfg.183.1545337149433; Thu, 20 Dec 2018 12:19:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545337149; cv=none; d=google.com; s=arc-20160816; b=vHEbM/WKCr59eAapAWOuhd+unxMi6+7Alhi20gWut6lgPLGdzsJfG6a2TWJNLAPQVq bEcZiX7OSj6USNq4dUqZboaVsALo+2Y3ga5A8prOFS6VX0AXfKhZ0lBOl/NRUdKYi5lD 6sqC10VtIL+Eq614UxpcTLtc9BIcbvWKG5DicMHf0huLZbUquU30eSyFdPSzPY/gBmC2 DSZdXolB37oWquUNqJ+HDMKsj3eANC47IiMYjGIYS6Voc/Xz5yPsReaMGl26VwGkYVt8 012x59SIUV4QqIEQ8ncKy/U0/jGFOn5WBroCA8kweUABwa6H4KcfeeXf/l0qGr+JoS4i fsqA== 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=bSWucqY+YGe6iH8dp/RhOPOt0BgToRs9xgFWKJxzmKk=; b=0vmFL4skG6nleEa5Oem/QdAzjEzcnLY8fog2KRAPKDXI/yGBavVWKKR41MsKf5KHzu KffV5gzzAyQYI9xVF58OtKITN8Tg+7rbOVvMqdCSAP8USXjkdck31sqANjzAMVAT5Z8L xf6jG0tZYNCzOeMq5mc5D2Odsbo4LrwjFoIGXGvI19Hax4+MBM2ZcaW8Oh/oGKp0KSIx IfEXtbfyGuvQUxW35AyLrSOOYbKa1Q0nd47krt4PdVDmtYWEFQ45hifHeQChaaUUjZh6 OclF5kp8PojgeXhKpgv7HflBnhP8S9LLa020VPzvDh8ZDWKoV/eF2O05Rx8gPBXiiyko g4dA== 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 f63si20297400pfg.136.2018.12.20.12.18.50; Thu, 20 Dec 2018 12:19:09 -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 S1732096AbeLTMuy (ORCPT + 99 others); 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 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 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) -- 2.7.4