From patchwork Thu Sep 17 16:44:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 53834 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by patches.linaro.org (Postfix) with ESMTPS id AEBC922A0D for ; Thu, 17 Sep 2015 16:45:35 +0000 (UTC) Received: by wicgb1 with SMTP id gb1sf9659968wic.3 for ; Thu, 17 Sep 2015 09:45:35 -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=YsTITPHYPa9e+6AHmc4F4pk8SmNIG5mIAJewo09++68=; b=J0/MZVOFnKVjhIvzQ0JMmq5lUMl4wDWhkqdNDQSsuXzBxSK0+R8qUtmKWvMfAXeS7j 1y5EQpKC6u3/tvYN1aUv2KRwSM9x+sSadWfKJUTt+8v1J3chCvj7Zpyk4f5WFPRxjnFy 3u4/Ll3kI4QKmV+mcvt+2aps4N5rvTqSXPbJeQNBBwym+v66MnxZR/pWvGuPC67okp2W mFlQP2/LbyFdoZuJl9B8mlEGTHorZEpaPLFDX+LURyjaDlXxdGakikzIEf8PhX8Akftv P/c1ph2hqpZZAPoB7MmRhpFAFdgDDYGgiWmbU1SlH3vkryK2G0i7q4enrSFl6gnXqDWg CjUw== X-Gm-Message-State: ALoCoQlibTMo+dUEGnH+1sDypbjt04W1OUTeWkHhtMVYh88gM8mzUyITO8UC4nxD3Afo9v2HTx/Q X-Received: by 10.112.149.39 with SMTP id tx7mr13247lbb.11.1442508335030; Thu, 17 Sep 2015 09:45:35 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.10.7 with SMTP id e7ls117041lab.70.gmail; Thu, 17 Sep 2015 09:45:34 -0700 (PDT) X-Received: by 10.112.138.37 with SMTP id qn5mr164003lbb.52.1442508334717; Thu, 17 Sep 2015 09:45:34 -0700 (PDT) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id t2si2782285lbo.80.2015.09.17.09.45.34 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Sep 2015 09:45:34 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by lbbvu2 with SMTP id vu2so12501864lbb.0 for ; Thu, 17 Sep 2015 09:45:34 -0700 (PDT) X-Received: by 10.152.170.225 with SMTP id ap1mr158370lac.72.1442508334543; Thu, 17 Sep 2015 09:45:34 -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 w3csp3179026lbq; Thu, 17 Sep 2015 09:45:33 -0700 (PDT) X-Received: by 10.66.142.69 with SMTP id ru5mr159180pab.1.1442508326157; 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.25; 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 S1751752AbbIQQpH (ORCPT + 4 others); Thu, 17 Sep 2015 12:45:07 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:50631 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751979AbbIQQpE (ORCPT ); Thu, 17 Sep 2015 12:45:04 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id t8HGj41S024052 for ; Thu, 17 Sep 2015 11:45:04 -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 t8HGj3Xt014858 for ; Thu, 17 Sep 2015 11:45:04 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.224.2; Thu, 17 Sep 2015 11:45:04 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t8HGj3fC018126; Thu, 17 Sep 2015 11:45:03 -0500 From: Felipe Balbi To: Linux USB Mailing List CC: Felipe Balbi Subject: [PATCH RESEND 2/4] usb: dwc3: gadget: clear DWC3_PENDING_REQUEST when request is queued Date: Thu, 17 Sep 2015 11:44:58 -0500 Message-ID: <1442508300-20858-2-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1442508300-20858-1-git-send-email-balbi@ti.com> References: <1442508300-20858-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.217.169 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; }