From patchwork Tue Sep 15 17:52:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 53694 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by patches.linaro.org (Postfix) with ESMTPS id 9CAF522A0D for ; Tue, 15 Sep 2015 17:52:32 +0000 (UTC) Received: by lamf6 with SMTP id f6sf27819121lam.1 for ; Tue, 15 Sep 2015 10:52:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-type:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe; bh=Is0tKl2UzOIIUfkwjBPwUSnpXAr9N17Q4znweHFpI0o=; b=OTPttk3ShfwMjImG/SawhVRGWQ9V/yG0UeEPVAVXCWrC305T5r51OigZgt42P6eHeg WzNAqRwVXvXs09obMJ6SFCTRjKvx7rM0HjmxiVEmoC4nuqSc5QsUElxwqf6g68QTvNOu Tka4tv0STC7bqbkTSY/6Az0iMnUFoSn8acSV1u9OV6vj6FG5itGDOqMVxQHKd32O+wlV Y7K0wR2bVWQT6VrFWzigLLZ4HPJRdAauYNkIiDetbewQMNGkjLZQET61Kx4qTpuPWePG OEyYW4sdthGncunA/MwWHNYPnBJAU8Sa6p04Pw1+DtGo6SajSFgVyLsRU3lHckjRaHes IrEw== X-Gm-Message-State: ALoCoQn769P+oc6sZ2zB4qczA9aHRFTS1ebTW118jIweuf2B3n2n2CNEeWSXbOgesIeFoc2uqw84 X-Received: by 10.152.9.36 with SMTP id w4mr1998130laa.7.1442339551501; Tue, 15 Sep 2015 10:52:31 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.18.137 with SMTP id w9ls375671lad.93.gmail; Tue, 15 Sep 2015 10:52:31 -0700 (PDT) X-Received: by 10.112.85.204 with SMTP id j12mr22844675lbz.47.1442339551354; Tue, 15 Sep 2015 10:52:31 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id sk1si15110878lbb.44.2015.09.15.10.52.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Sep 2015 10:52:31 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by lbbmp1 with SMTP id mp1so89817642lbb.1 for ; Tue, 15 Sep 2015 10:52:31 -0700 (PDT) X-Received: by 10.152.43.137 with SMTP id w9mr23927762lal.56.1442339551237; Tue, 15 Sep 2015 10:52:31 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1949292lbq; Tue, 15 Sep 2015 10:52:30 -0700 (PDT) X-Received: by 10.50.50.240 with SMTP id f16mr8327615igo.95.1442339550170; Tue, 15 Sep 2015 10:52:30 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qp7si33602949pbc.93.2015.09.15.10.52.28; Tue, 15 Sep 2015 10:52:30 -0700 (PDT) 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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751702AbbIORw1 (ORCPT + 4 others); Tue, 15 Sep 2015 13:52:27 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:33240 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751070AbbIORwZ (ORCPT ); Tue, 15 Sep 2015 13:52:25 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id t8FHqPQe013638 for ; Tue, 15 Sep 2015 12:52:25 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id t8FHqPQB026379 for ; Tue, 15 Sep 2015 12:52:25 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.224.2; Tue, 15 Sep 2015 12:52:25 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t8FHqO7G029617; Tue, 15 Sep 2015 12:52:24 -0500 From: Felipe Balbi To: Linux USB Mailing List CC: Felipe Balbi Subject: [PATCH 1/5] usb: dwc3: gadget: start requests as soon as they come Date: Tue, 15 Sep 2015 12:52:18 -0500 Message-ID: <1442339542-17090-2-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1442339542-17090-1-git-send-email-balbi@ti.com> References: <1442339542-17090-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: balbi@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , In an attempt to make dwc3 slightly faster, let's start usb_requests as soon as they come as that will let us avoid a XFER_NOT_READY event and save a little bit of time. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 1ea565f307e4..14cb982235b7 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1072,6 +1072,21 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req) list_add_tail(&req->list, &dep->request_list); /* + * If there are no pending requests and the endpoint isn't already + * busy, we will just start the request straight away. + * + * This will save one IRQ (XFER_NOT_READY) and possibly make it a + * little bit faster. + */ + if (!(dep->flags & DWC3_EP_BUSY)) { + ret = __dwc3_gadget_kick_transfer(dep, 0, true); + if (ret && ret != -EBUSY) + dev_dbg(dwc->dev, "%s: failed to kick transfers\n", + dep->name); + return ret; + } + + /* * There are a few special cases: * * 1. XferNotReady with empty list of requests. We need to kick the