From patchwork Fri Oct 3 16:08:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 38345 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D30AA2057C for ; Fri, 3 Oct 2014 16:08:47 +0000 (UTC) Received: by mail-wg0-f70.google.com with SMTP id a1sf879841wgh.9 for ; Fri, 03 Oct 2014 09:08:47 -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:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=jcO+tX7/7JUaWoUOHZRVTmPwW1u0+59Tb772is1zqTY=; b=iF21TmjrCjdiS8xnv6Rip0OFZeUaabSnXKl1gOutkKamQQ0Cj+rNXQJk71WnmyTOSn 2TkD4+ofLZDDMwGdW1/uZXVfwheSxVKtccEbPhlGCUZA/yOfkvx3SUoOoas+GgCyQB+e orqXLpcqbwR0g28+yuwdrZunPXxJw1tU59w4PV4MoP2Dwz1q2I4q2Ckglo/Fx/V5eixT NcvgI8aSXNId0Yve2yNcAvmbfKV9/eqSmBtRwkcq3pYf+Upb5mvP/x4hq08P1p1smBsO SLR1grLHXZVpAV0iYFM+7K71Cki7BoF+nDmUS51T5/H/hVht+EWYzS8mafbG7gFvLzTN txkg== X-Gm-Message-State: ALoCoQlghPnkOrHDEcClB4ND58VryFobaqAp+f61nGwtZaEoFHkUpG4aFJ4+Vbx74kQhWDbPSvKE X-Received: by 10.181.25.234 with SMTP id it10mr954740wid.1.1412352527053; Fri, 03 Oct 2014 09:08:47 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.9 with SMTP id o9ls346577lao.97.gmail; Fri, 03 Oct 2014 09:08:46 -0700 (PDT) X-Received: by 10.152.87.146 with SMTP id ay18mr4650874lab.92.1412352526886; Fri, 03 Oct 2014 09:08:46 -0700 (PDT) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com [209.85.215.48]) by mx.google.com with ESMTPS id b11si11796350lbq.121.2014.10.03.09.08.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 Oct 2014 09:08:46 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by mail-la0-f48.google.com with SMTP id gi9so1310359lab.21 for ; Fri, 03 Oct 2014 09:08:46 -0700 (PDT) X-Received: by 10.152.22.137 with SMTP id d9mr6931035laf.29.1412352526629; Fri, 03 Oct 2014 09:08:46 -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.130.169 with SMTP id of9csp256492lbb; Fri, 3 Oct 2014 09:08:45 -0700 (PDT) X-Received: by 10.69.31.1 with SMTP id ki1mr8154311pbd.100.1412352524314; Fri, 03 Oct 2014 09:08:44 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gg1si7629914pac.50.2014.10.03.09.08.43 for ; Fri, 03 Oct 2014 09:08:44 -0700 (PDT) Received-SPF: none (google.com: stable-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753271AbaJCQIn (ORCPT + 1 other); Fri, 3 Oct 2014 12:08:43 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:56430 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752489AbaJCQIm (ORCPT ); Fri, 3 Oct 2014 12:08:42 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id s93G8gF6011325; Fri, 3 Oct 2014 11:08:42 -0500 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s93G8gx3019469; Fri, 3 Oct 2014 11:08:42 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Fri, 3 Oct 2014 11:08:41 -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 s93G8fIi010560; Fri, 3 Oct 2014 11:08:41 -0500 From: Felipe Balbi To: Greg KH CC: , Felipe Balbi Subject: [PATCH v3.14-stable 3/3] usb: dwc3: fix TRB completion when multiple TRBs are started Date: Fri, 3 Oct 2014 11:08:43 -0500 Message-ID: <1412352523-31144-3-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.1.0.GIT In-Reply-To: <1412352523-31144-1-git-send-email-balbi@ti.com> References: <1412352523-31144-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: stable@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.48 as permitted sender) smtp.mail=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: , commit 0b93a4c838fa10370d72f86fe712426ac63804de upstream After commit 2ec2a8be (usb: dwc3: gadget: always enable IOC on bulk/interrupt transfers) we created a situation where it was possible to hang a bulk/interrupt endpoint if we had more than one pending request in our queue and they were both started with a single Start Transfer command. The problems triggers because we had not enabled Transfer In Progress event for those endpoints and we were not able to process early giveback of requests completed without LST bit set. Fix the problem by finally enabling Xfer In Progress event for all endpoint types, except control. Fixes: 2ec2a8be (usb: dwc3: gadget: always enable IOC on bulk/interrupt transfers) Cc: # v3.14+ Reported-by: Pratyush Anand Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 09e9619..02d0c1f 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -445,7 +445,7 @@ static int dwc3_gadget_set_ep_config(struct dwc3 *dwc, struct dwc3_ep *dep, dep->stream_capable = true; } - if (usb_endpoint_xfer_isoc(desc)) + if (!usb_endpoint_xfer_control(desc)) params.param1 |= DWC3_DEPCFG_XFER_IN_PROGRESS_EN; /* @@ -1937,12 +1937,6 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc, dwc3_endpoint_transfer_complete(dwc, dep, event, 1); break; case DWC3_DEPEVT_XFERINPROGRESS: - if (!usb_endpoint_xfer_isoc(dep->endpoint.desc)) { - dev_dbg(dwc->dev, "%s is not an Isochronous endpoint\n", - dep->name); - return; - } - dwc3_endpoint_transfer_complete(dwc, dep, event, 0); break; case DWC3_DEPEVT_XFERNOTREADY: