From patchwork Fri Oct 3 16:09:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 38346 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 575792057C for ; Fri, 3 Oct 2014 16:10:00 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id hi2sf1011335wib.5 for ; Fri, 03 Oct 2014 09:09:59 -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:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe:content-type; bh=WXQRx4Rct/fV4ZHf0Jy+U/yR4ZaFzIjfB0kfCdhHTds=; b=jkkh6RBU1FacRdoryrEnBjw6cXW50v81G8jKhuhUud9mMMMeq3ir9v5sdYP40nV0ym xyKX0cJNxVFKK0lKQKKtK5shE5QCeSTiD8A9YI+wCjoamCec3sEpchAoKjEYsInpzFBy zU5e1SVIpW15Pt7aKa9IyAfQmoXm+K5b908IfbHzaVpSVSp9k+2gx9s1d3jRiQ6CuIca hXltJGJ339BhV2MQxUKNuN08fsctCWdm0iZc0sXUqR0FcP2FRjeMHd28FzRXF4YAZKpS ozrTkJSwuVpKCyq39TSVYFHSTI8AQ/iPDLFNpaaQxYLQ+uug+xB98US+EpqFkCwdOeze JZcA== X-Gm-Message-State: ALoCoQmCERM7lugLxbK7L6Jg/ESws8X03XpG+SxgAADMEgga03u1jWjnj59Lvu+u6ThxVT4/jjHC X-Received: by 10.112.89.8 with SMTP id bk8mr1144560lbb.6.1412352599497; Fri, 03 Oct 2014 09:09:59 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.8 with SMTP id f8ls380825lah.85.gmail; Fri, 03 Oct 2014 09:09:59 -0700 (PDT) X-Received: by 10.152.87.170 with SMTP id az10mr7107778lab.20.1412352599356; Fri, 03 Oct 2014 09:09:59 -0700 (PDT) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx.google.com with ESMTPS id g1si11883563lam.75.2014.10.03.09.09.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 Oct 2014 09:09:58 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by mail-lb0-f182.google.com with SMTP id z11so1280182lbi.27 for ; Fri, 03 Oct 2014 09:09:58 -0700 (PDT) X-Received: by 10.152.22.137 with SMTP id d9mr6938985laf.29.1412352598778; Fri, 03 Oct 2014 09:09:58 -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 of9csp256759lbb; Fri, 3 Oct 2014 09:09:58 -0700 (PDT) X-Received: by 10.70.96.74 with SMTP id dq10mr1627093pdb.165.1412352597295; Fri, 03 Oct 2014 09:09:57 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fm3si7588527pab.94.2014.10.03.09.09.55 for ; Fri, 03 Oct 2014 09:09:57 -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 S1753301AbaJCQJy (ORCPT + 1 other); Fri, 3 Oct 2014 12:09:54 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:59404 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752711AbaJCQJy (ORCPT ); Fri, 3 Oct 2014 12:09:54 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id s93G9pYH006981; Fri, 3 Oct 2014 11:09:51 -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 s93G9pXm001331; Fri, 3 Oct 2014 11:09:51 -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.174.1; Fri, 3 Oct 2014 11:09:51 -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 s93G9oGe032270; Fri, 3 Oct 2014 11:09:51 -0500 From: Felipe Balbi To: Greg KH CC: , Felipe Balbi Subject: [PATCH v3.16-stable] usb: dwc3: fix TRB completion when multiple TRBs are started Date: Fri, 3 Oct 2014 11:09:55 -0500 Message-ID: <1412352595-398-1-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.1.0.GIT 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.217.182 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 dab7927..f5b352a 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -527,7 +527,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; /* @@ -2042,12 +2042,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: