From patchwork Tue Sep 15 19:16:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 53700 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by patches.linaro.org (Postfix) with ESMTPS id B954522A0D for ; Tue, 15 Sep 2015 19:16:17 +0000 (UTC) Received: by lbot4 with SMTP id t4sf11909226lbo.0 for ; Tue, 15 Sep 2015 12:16:16 -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=SY2dKHOCuMYq6H2auWmEPFAmfZuoerhbpUu7et2OuPo=; b=E9zaNFCZ/cwtO7LHlekb/stgHp3v3GTWRfDgb2w9dPBlFoZuRBpKuAgTVL2u0fe2+P ONEqueY4s994GGosrH55xBktUaGD2vF6NmTV7+w0yGVhshC+G8gj+i1YqZOwXjSrIIUd inZSHIsvF4uguBNdgPs6k53w3sHg2vzb4IN43+Q5D1vEfqTPNW2mzlGqEpreW3xe5m23 VhbJX/MMgWigYZC5Y4rlIsUo6CmpHqT0sYAtPM+rzuaNIDMXq85rHI5ITaV21sXqnXQq Ku25sGVumAPSTpynZx0c4gL1MC9SVfvkPygFARrsuyvOouXLVC4fGNl50Ltbws9R+ujk 6gMQ== X-Gm-Message-State: ALoCoQk+F+9bNTzi9a8+Q275nbooQDIVJtmpO9cOLiDg7i6tufmk9tUCr/mJcJsKXV/u9g3cOxHr X-Received: by 10.112.89.228 with SMTP id br4mr4606968lbb.3.1442344576732; Tue, 15 Sep 2015 12:16:16 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.44.168 with SMTP id f8ls24963lam.50.gmail; Tue, 15 Sep 2015 12:16:16 -0700 (PDT) X-Received: by 10.152.26.41 with SMTP id i9mr24025176lag.36.1442344576581; Tue, 15 Sep 2015 12:16:16 -0700 (PDT) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id ab1si6450433lbc.108.2015.09.15.12.16.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Sep 2015 12:16:16 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by lanb10 with SMTP id b10so113878318lan.3 for ; Tue, 15 Sep 2015 12:16:16 -0700 (PDT) X-Received: by 10.152.219.34 with SMTP id pl2mr17299306lac.29.1442344576471; Tue, 15 Sep 2015 12:16:16 -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 w3csp1990060lbq; Tue, 15 Sep 2015 12:16:15 -0700 (PDT) X-Received: by 10.50.114.65 with SMTP id je1mr9471332igb.20.1442344575295; Tue, 15 Sep 2015 12:16:15 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d7si13572503igo.56.2015.09.15.12.16.15; Tue, 15 Sep 2015 12:16:15 -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 S1751852AbbIOTQN (ORCPT + 4 others); Tue, 15 Sep 2015 15:16:13 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:46819 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751622AbbIOTQL (ORCPT ); Tue, 15 Sep 2015 15:16:11 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id t8FJGB9g011006 for ; Tue, 15 Sep 2015 14:16:11 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id t8FJGBur009371 for ; Tue, 15 Sep 2015 14:16:11 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.224.2; Tue, 15 Sep 2015 14:16:11 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id t8FJGA4c010791; Tue, 15 Sep 2015 14:16:11 -0500 From: Felipe Balbi To: Linux USB Mailing List CC: Felipe Balbi Subject: [PATCH v2 1/5] usb: dwc3: gadget: start requests as soon as they come Date: Tue, 15 Sep 2015 14:16:04 -0500 Message-ID: <1442344568-1820-2-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1442344568-1820-1-git-send-email-balbi@ti.com> References: <1442344568-1820-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.215.48 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 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 1ea565f307e4..d28dc6df4e55 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1072,6 +1072,22 @@ 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 (!usb_endpoint_xfer_isoc(dep->endpoint.desc) && + !(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