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: Zeng Tao X-Patchwork-Id: 154331 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6131298ljp; Thu, 20 Dec 2018 04:50:56 -0800 (PST) X-Google-Smtp-Source: AFSGD/WPxguFXoNC+QL/4zGuKM8lpBJBj+F1dympzDP3nvFUj6MrbU2kuJ9fHJg1aBI4CZDvjoX1 X-Received: by 2002:a62:7f93:: with SMTP id a141mr8927717pfd.96.1545310256003; Thu, 20 Dec 2018 04:50:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545310255; cv=none; d=google.com; s=arc-20160816; b=ZmiFDPcjtxHIyyeY432z65qSwCaNXE8oqLmnpa6SFW66uM8aHgR08EZw0JtDg/PB4Y 8c+RkF2yAvSI18oZ4AXzv7dclY7Ca/MeAVNZHO2L0ynUOUiCqFFpBE0RCSUWGzO1NtUw 9aMGHw4pl4Xz/sQxUZmKcdmbY3nOscrNH9DppRWSU8CeESh2VxW38LV3uvTNx1MtwMmg YOzDGMpzmVBc8RcCn5PoyTOpB2cdNg9hs0bDTLRNSyojGIFOKT45hCHK0aToTjKHEin9 IKezw3/aiae84OHp5T18uAAae6uwLwOfUkdUiUreYXduhI88nQAMnPcgQDh8qh+gdJEZ qbtA== 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 o14si1924682pgj.59.2018.12.20.04.50.55; Thu, 20 Dec 2018 04:50:55 -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 S1732615AbeLTMuy (ORCPT + 31 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 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(-) -- 2.7.4 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)