From patchwork Thu Sep 17 16:42:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 53831 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by patches.linaro.org (Postfix) with ESMTPS id A66EE22A0D for ; Thu, 17 Sep 2015 16:42:55 +0000 (UTC) Received: by wisv5 with SMTP id v5sf9621715wis.0 for ; Thu, 17 Sep 2015 09:42:55 -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=YsTITPHYPa9e+6AHmc4F4pk8SmNIG5mIAJewo09++68=; b=esgNJsEbdncLBq9YWK3f066WHqTpxAM14X9srVyF4RKzYwuLd5LFPh1um7JyIUoDz7 lLX3PJY67aCso7GfsVLoHjMbYapPHoTuOnjimxeg303HE8Y2Ry1xdfHAI9lVFjoBuGuU Nrx1yMc/QvCDVFZkoV/ya00BN5liF2rt6X2EMfOBNrQ62vKO207r90swfaJBbAk74ptT LFPhPm3fjlHUM8D21R72i6YP6ZeP5aNqN9iF2b8K1/8eGf+bAXTYOwcI9wgUBu9DW90C /XgJchQ+0OltZZHV7qJtRGIXf3EbthSr0WBC9VddFdlBmTTo0Md8UBEMGcL6wz7QG34p 6isA== X-Gm-Message-State: ALoCoQk5RWTuWXpei0MmbTHa73M/DxXi+7umSbKC7w9F/dnntFGtWONEDz7vg7dDAeTg98nEz0xE X-Received: by 10.112.130.41 with SMTP id ob9mr8735lbb.17.1442508174950; Thu, 17 Sep 2015 09:42:54 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.10 with SMTP id w10ls130884law.69.gmail; Thu, 17 Sep 2015 09:42:54 -0700 (PDT) X-Received: by 10.112.16.67 with SMTP id e3mr104068lbd.5.1442508174683; Thu, 17 Sep 2015 09:42:54 -0700 (PDT) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com. [209.85.215.43]) by mx.google.com with ESMTPS id s3si2894903lae.143.2015.09.17.09.42.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Sep 2015 09:42:54 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by lamp12 with SMTP id p12so14693517lam.0 for ; Thu, 17 Sep 2015 09:42:54 -0700 (PDT) X-Received: by 10.152.5.170 with SMTP id t10mr119959lat.112.1442508174557; Thu, 17 Sep 2015 09:42: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 w3csp3177668lbq; Thu, 17 Sep 2015 09:42:53 -0700 (PDT) X-Received: by 10.66.253.229 with SMTP id ad5mr74211pad.101.1442508173501; Thu, 17 Sep 2015 09:42:53 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dn2si6446320pbb.210.2015.09.17.09.42.53; Thu, 17 Sep 2015 09:42: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 S1752651AbbIQQmv (ORCPT + 4 others); Thu, 17 Sep 2015 12:42:51 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:57710 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752571AbbIQQmu (ORCPT ); Thu, 17 Sep 2015 12:42:50 -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 t8HGgnBw016924 for ; Thu, 17 Sep 2015 11:42:49 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id t8HGgnCc005630 for ; Thu, 17 Sep 2015 11:42:49 -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; Thu, 17 Sep 2015 11:42:50 -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 t8HGgndV022432; Thu, 17 Sep 2015 11:42:49 -0500 From: Felipe Balbi To: Linux USB Mailing List CC: Felipe Balbi Subject: [PATCH 1/3] usb: dwc3: gadget: clear DWC3_PENDING_REQUEST when request is queued Date: Thu, 17 Sep 2015 11:42:38 -0500 Message-ID: <1442508160-20601-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.215.43 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: , Instead of clearing DWC3_PENDING_REQUEST when we start transfer, let's do it when the request is actually queued, that way we know for sure that we're clearing in the right time. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index d28dc6df4e55..2cc6a33438dc 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -948,7 +948,6 @@ static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep, u16 cmd_param, dwc3_trace(trace_dwc3_gadget, "%s: endpoint busy", dep->name); return -EBUSY; } - dep->flags &= ~DWC3_EP_PENDING_REQUEST; /* * If we are getting here after a short-out-packet we don't enqueue any @@ -1117,6 +1116,10 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req) if (ret && ret != -EBUSY) dev_dbg(dwc->dev, "%s: failed to kick transfers\n", dep->name); + + if (!ret) + dep->flags &= ~DWC3_EP_PENDING_REQUEST; + return ret; }