From patchwork Mon Sep 28 20:19:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 54209 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 2A6E322B1E for ; Mon, 28 Sep 2015 20:19:56 +0000 (UTC) Received: by laer8 with SMTP id r8sf28764686lae.2 for ; Mon, 28 Sep 2015 13:19:54 -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=AxXBbQRTiH8yq6UU2UMvFzFuqfvozSCe9mxjapDbbLY=; b=T4QGRkNoPy/XyjXHTpFMk7S39CUt1KvHyotB3ukBq7FEFg2Hh16JdVknqayn86Jgml mJ1BSLjU6opWGQqXzGC50Pxow8jV5itQ/0bjz1Kcm1NEfTnFRjOVS1Uefeyq/KlRTX0d dsHYA/PyoKsEeWbNLRCIfVPWxX/TQZOjlDBuWkVS5se7UPg0iwLIKVgnAO4HgfvlmOZl OooeJ7jSLfHfv3ZqiwoKuhMH77hHG3zDNg8+mXfzFaQHlgGmYqYURLIStQXJwVCf5oRf e4YhfYbaQKw/KjxEcr1kBYY7eB6SexyWOsfJEo4O0OTULb4J932UUZgZGFaLAInA/dl3 3n6A== X-Gm-Message-State: ALoCoQmnilPWMwRwfdSFKPqKNCdzsB+u0htQMS926O5ICG3n281vz8xIb5IRu/Xs/ctiC1iOm04c X-Received: by 10.180.105.98 with SMTP id gl2mr3191891wib.0.1443471594808; Mon, 28 Sep 2015 13:19:54 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.18.233 with SMTP id z9ls83118lad.53.gmail; Mon, 28 Sep 2015 13:19:54 -0700 (PDT) X-Received: by 10.152.8.170 with SMTP id s10mr1002711laa.24.1443471594656; Mon, 28 Sep 2015 13:19:54 -0700 (PDT) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id o17si9129305lfo.78.2015.09.28.13.19.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Sep 2015 13:19:54 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by laclj5 with SMTP id lj5so79759407lac.3 for ; Mon, 28 Sep 2015 13:19:54 -0700 (PDT) X-Received: by 10.112.64.72 with SMTP id m8mr5992395lbs.41.1443471594170; Mon, 28 Sep 2015 13:19:54 -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 w3csp1751322lbq; Mon, 28 Sep 2015 13:19:53 -0700 (PDT) X-Received: by 10.50.4.65 with SMTP id i1mr5987397igi.0.1443471593208; Mon, 28 Sep 2015 13:19:53 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e62si13949338iod.102.2015.09.28.13.19.52; Mon, 28 Sep 2015 13:19:53 -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 S1752544AbbI1UTv (ORCPT + 4 others); Mon, 28 Sep 2015 16:19:51 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:55405 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751956AbbI1UTu (ORCPT ); Mon, 28 Sep 2015 16:19:50 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id t8SKJoPj017272 for ; Mon, 28 Sep 2015 15:19:50 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id t8SKJotH005417 for ; Mon, 28 Sep 2015 15:19:50 -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; Mon, 28 Sep 2015 15:19:50 -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 t8SKJnVd021710; Mon, 28 Sep 2015 15:19:49 -0500 From: Felipe Balbi To: Linux USB Mailing List CC: Felipe Balbi Subject: [PATCH 1/3] usb: dwc3: gadget: use update transfer command Date: Mon, 28 Sep 2015 15:19:42 -0500 Message-ID: <1443471584-21683-1-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.5.0.GIT 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.45 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: , If we get a Xfer Not Ready event with reason "Transfer Active" it means endpoint is still transferring data and we can use that to issue update transfer for this particular endpoint in case we have pending requests in our queue. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index c57e2002bcff..ee3d05fa674d 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2012,15 +2012,16 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc, if (usb_endpoint_xfer_isoc(dep->endpoint.desc)) { dwc3_gadget_start_isoc(dwc, dep, event); } else { + int active; int ret; + active = event->status & DEPEVT_STATUS_TRANSFER_ACTIVE; + dwc3_trace(trace_dwc3_gadget, "%s: reason %s", - dep->name, event->status & - DEPEVT_STATUS_TRANSFER_ACTIVE - ? "Transfer Active" + dep->name, active ? "Transfer Active" : "Transfer Not Active"); - ret = __dwc3_gadget_kick_transfer(dep, 0, 1); + ret = __dwc3_gadget_kick_transfer(dep, 0, !active); if (!ret || ret == -EBUSY) return;