From patchwork Tue Sep 15 17:52:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 53698 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 0F25F22A0D for ; Tue, 15 Sep 2015 17:52:42 +0000 (UTC) Received: by lanb10 with SMTP id b10sf63784167lan.3 for ; Tue, 15 Sep 2015 10:52:41 -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=dKK7+K0pgWedeOyhviM5JI3QBzJvREikxkdL2FVpbkc=; b=HbALFhwkvDOTMqg0aRf7EZGtuvSo0vwewop6OMsohLZx+CmF0f73eRvedeL8W2GzPJ BBTHyuKRHK3sWPBZvkpqEDGW7f7JGkSzEooqTKO9qphW6ST3fUUH5/4AZ1T61zmPAPMJ qVcNnsZQERWz9XQL1jAcPBBLWwQA+MAseMCZU/Qi2XOqT8JfklC0NyL0dnGfOisVcLER bLRM+2VPVQVW6k6znJbyp+7vi5DbL3+9LNFIS1wmkz1zDW6vhoolQwOOXHnkhI3Lx6g9 nqOYEe4QYEj1kjU9DPJ4ADvKTEc/ohUWlBesLI1Y7xwzUPsNAzGuDbDdRIPJ5A+Jgu95 N00g== X-Gm-Message-State: ALoCoQkoj5wWgTWpXx9vFT6lukWL5NTuROar1XyBGBEwZbCMy5jz4lvtKGET9VrU72KJj2kjFDCi X-Received: by 10.152.26.5 with SMTP id h5mr835148lag.5.1442339560958; Tue, 15 Sep 2015 10:52:40 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.42 with SMTP id g10ls418227lah.91.gmail; Tue, 15 Sep 2015 10:52:40 -0700 (PDT) X-Received: by 10.112.62.137 with SMTP id y9mr22961334lbr.63.1442339560815; Tue, 15 Sep 2015 10:52:40 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id 7si15089357lan.162.2015.09.15.10.52.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Sep 2015 10:52:40 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by lahg1 with SMTP id g1so83606194lah.1 for ; Tue, 15 Sep 2015 10:52:40 -0700 (PDT) X-Received: by 10.152.5.133 with SMTP id s5mr23443920las.19.1442339560709; Tue, 15 Sep 2015 10:52:40 -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 w3csp1949384lbq; Tue, 15 Sep 2015 10:52:39 -0700 (PDT) X-Received: by 10.107.128.145 with SMTP id k17mr39792885ioi.24.1442339555211; Tue, 15 Sep 2015 10:52:35 -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.34; Tue, 15 Sep 2015 10:52:35 -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 S1751806AbbIORwb (ORCPT + 4 others); Tue, 15 Sep 2015 13:52:31 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:46851 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751622AbbIORw2 (ORCPT ); Tue, 15 Sep 2015 13:52:28 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id t8FHqSDN000326 for ; Tue, 15 Sep 2015 12:52:28 -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 t8FHqSux022352 for ; Tue, 15 Sep 2015 12:52:28 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.224.2; Tue, 15 Sep 2015 12:52:28 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t8FHqR3D007745; Tue, 15 Sep 2015 12:52:27 -0500 From: Felipe Balbi To: Linux USB Mailing List CC: Felipe Balbi Subject: [PATCH 4/5] usb: dwc3: gadget: remove 'start_new' parameter Date: Tue, 15 Sep 2015 12:52:21 -0500 Message-ID: <1442339542-17090-5-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.215.52 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: , The start_new parameter for dwc3_gadget_kick_transfer() is now rendered pointless since driver understands that it should use Update Transfer command when the queue is busy. Let's remove that parameter and make sure we can update transfers which are still in flight. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 8ef6c57ab918..e97f328cbff6 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -935,8 +935,7 @@ static void dwc3_prepare_trbs(struct dwc3_ep *dep, bool starting) } } -static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep, u16 cmd_param, - int start_new) +static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep, u16 cmd_param) { struct dwc3_gadget_ep_cmd_params params; struct dwc3_request *req; @@ -944,11 +943,6 @@ static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep, u16 cmd_param, int ret; u32 cmd; - if (start_new && (dep->flags & DWC3_EP_BUSY)) { - dwc3_trace(trace_dwc3_gadget, "%s: endpoint busy", dep->name); - return -EBUSY; - } - cmd = DWC3_DEPCMD_UPDATETRANSFER | DWC3_DEPCMD_PARAM(cmd_param); @@ -958,7 +952,7 @@ static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep, u16 cmd_param, */ if (list_empty(&dep->req_queued) && !(dep->flags & DWC3_EP_BUSY)) { - dwc3_prepare_trbs(dep, start_new); + dwc3_prepare_trbs(dep, true); cmd = DWC3_DEPCMD_STARTTRANSFER; } @@ -992,7 +986,7 @@ static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep, u16 cmd_param, dep->flags |= DWC3_EP_BUSY; - if (start_new) { + if (cmd == DWC3_DEPCMD_STARTTRANSFER) { dep->resource_index = dwc3_gadget_ep_get_transfer_index(dwc, dep->number); WARN_ON_ONCE(!dep->resource_index); @@ -1017,7 +1011,7 @@ static void __dwc3_gadget_start_isoc(struct dwc3 *dwc, /* 4 micro frames in the future */ uf = cur_uf + dep->interval * 4; - __dwc3_gadget_kick_transfer(dep, uf, 1); + __dwc3_gadget_kick_transfer(dep, uf); } static void dwc3_gadget_start_isoc(struct dwc3 *dwc, @@ -1070,7 +1064,7 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req) * little bit faster. */ if (!(dep->flags & DWC3_EP_BUSY)) { - ret = __dwc3_gadget_kick_transfer(dep, 0, true); + ret = __dwc3_gadget_kick_transfer(dep, 0); if (ret && ret != -EBUSY) dev_dbg(dwc->dev, "%s: failed to kick transfers\n", dep->name); @@ -1103,7 +1097,7 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req) return 0; } - ret = __dwc3_gadget_kick_transfer(dep, 0, true); + ret = __dwc3_gadget_kick_transfer(dep, 0); if (ret && ret != -EBUSY) dev_dbg(dwc->dev, "%s: failed to kick transfers\n", dep->name); @@ -1123,8 +1117,7 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req) (dep->flags & DWC3_EP_BUSY) && !(dep->flags & DWC3_EP_MISSED_ISOC)) { WARN_ON_ONCE(!dep->resource_index); - ret = __dwc3_gadget_kick_transfer(dep, dep->resource_index, - false); + ret = __dwc3_gadget_kick_transfer(dep, dep->resource_index); if (ret && ret != -EBUSY) dev_dbg(dwc->dev, "%s: failed to kick transfers\n", dep->name); @@ -1137,7 +1130,7 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req) * handled. */ if (dep->stream_capable) { - ret = __dwc3_gadget_kick_transfer(dep, 0, true); + ret = __dwc3_gadget_kick_transfer(dep, 0); if (ret && ret != -EBUSY) dev_dbg(dwc->dev, "%s: failed to kick transfers\n", dep->name); @@ -2010,7 +2003,7 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc, ? "Transfer Active" : "Transfer Not Active"); - ret = __dwc3_gadget_kick_transfer(dep, 0, 1); + ret = __dwc3_gadget_kick_transfer(dep, 0); if (!ret || ret == -EBUSY) return;