From patchwork Thu Sep 17 16:44:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 53835 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by patches.linaro.org (Postfix) with ESMTPS id 9E93A22A0D for ; Thu, 17 Sep 2015 16:45:38 +0000 (UTC) Received: by lagj9 with SMTP id j9sf9658652lag.0 for ; Thu, 17 Sep 2015 09:45:37 -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 :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=bSdefjgQyGtQoxuom6DY5AuwTj4I5S1FFszA8+s2t2z8AGY1yOhu/CVoGP2PLKZnSk lLCEmm9anL9bBQF3enNf7Ff6SMzOB87W5AwVaaZNmwMDNmiNimYGZRyTkrbxQTjfjIvc rncTTsWxjZIFFFmxvfyeT/041JIRcmgFMWcyhNUxYHFGTiUXA8cafntM4y0C7hSangZ6 /ZkNcWf/pbpe3H4NXan8qSftVuSQ1UF4LW9GAbDorWCK3IWnsIoSRh5YVOibmSn+7vxf ukTtursSogop210n72w1pyxo9xbR/VDQoo8RDvuPjOFR76d7pgsn2GSQZEUD3PCyAA30 A+Cw== X-Gm-Message-State: ALoCoQnC0sShr4qPAWik/aalH+f/NtqCkWpiAtU7xjsFqPvCxD/RP5p1NUmAoXeZc8Xr1Oxgd2HK X-Received: by 10.180.105.98 with SMTP id gl2mr3321753wib.0.1442508337619; Thu, 17 Sep 2015 09:45:37 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.198.135 with SMTP id jc7ls117378lac.54.gmail; Thu, 17 Sep 2015 09:45:37 -0700 (PDT) X-Received: by 10.112.204.101 with SMTP id kx5mr78501lbc.93.1442508337334; Thu, 17 Sep 2015 09:45:37 -0700 (PDT) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id w8si2921734lae.44.2015.09.17.09.45.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Sep 2015 09:45:37 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by lbbvu2 with SMTP id vu2so12502554lbb.0 for ; Thu, 17 Sep 2015 09:45:37 -0700 (PDT) X-Received: by 10.112.64.72 with SMTP id m8mr102272lbs.41.1442508337210; Thu, 17 Sep 2015 09:45:37 -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 w3csp3179046lbq; Thu, 17 Sep 2015 09:45:36 -0700 (PDT) X-Received: by 10.50.73.137 with SMTP id l9mr8145198igv.85.1442508326467; Thu, 17 Sep 2015 09:45:26 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gh4si6476996pac.134.2015.09.17.09.45.26; Thu, 17 Sep 2015 09:45:26 -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 S1751418AbbIQQpG (ORCPT + 4 others); Thu, 17 Sep 2015 12:45:06 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:48405 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752843AbbIQQpD (ORCPT ); Thu, 17 Sep 2015 12:45:03 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id t8HGj3Vd019905 for ; Thu, 17 Sep 2015 11:45:03 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id t8HGj3uk011644 for ; Thu, 17 Sep 2015 11:45:03 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.224.2; Thu, 17 Sep 2015 11:45:03 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id t8HGj1a3007848; Thu, 17 Sep 2015 11:45:02 -0500 From: Felipe Balbi To: Linux USB Mailing List CC: Felipe Balbi Subject: [PATCH RESEND 1/4] usb: dwc3: gadget: start requests as soon as they come Date: Thu, 17 Sep 2015 11:44:57 -0500 Message-ID: <1442508300-20858-1-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.5.0 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.179 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