From patchwork Fri Sep 5 14:17:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 36847 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f70.google.com (mail-yh0-f70.google.com [209.85.213.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 13067202A1 for ; Fri, 5 Sep 2014 14:18:03 +0000 (UTC) Received: by mail-yh0-f70.google.com with SMTP id b6sf40151573yha.5 for ; Fri, 05 Sep 2014 07:18:02 -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=VGOibv6ip9pal1VL4q8bLl4LyWiTBIoNd38Yn0qB50M=; b=PjtwWn6Rhj7PyQ9/wTFFqnzqygQ2xeQgoMxL5rNaQdNhYdezWqY880DUUTKdIhtlTj b3OTRYvuNSIzhIU4kb+afOkzzihWahRVqL3Ry08c97S894Hin/TJ6eUdqIeIN4jhnzOp i7qiv4fnyBJXedvEnbcdt/F1edgXihJOnvo2yPc7oXQoTMO/8t5K4WaavfQ1/5th7x1C yf1hs8UxwVmnNljIOri2scMS4DCrT4tTtH3ptQteSMv+d2S7cxReuVH8XTvLDv6d/4uk AR0ulTtHGEV6hJppI6tONXyH6UoZUbIaKRpFB58f212EwrcUw47geACPOOi9fqYI+xZw d+MQ== X-Gm-Message-State: ALoCoQnW/RQUWowVvHpWaoyyiPF5gXqCRTw3jeDViWZ2M8ZosDiQdd+U1+qRh35tN6/zOMUitKqD X-Received: by 10.224.45.133 with SMTP id e5mr7008816qaf.3.1409926682834; Fri, 05 Sep 2014 07:18:02 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.86.9 with SMTP id o9ls754745qgd.47.gmail; Fri, 05 Sep 2014 07:18:02 -0700 (PDT) X-Received: by 10.52.102.204 with SMTP id fq12mr9076187vdb.26.1409926682678; Fri, 05 Sep 2014 07:18:02 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id kl5si1311170vdb.26.2014.09.05.07.18.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 05 Sep 2014 07:18:02 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id hy4so12364079vcb.38 for ; Fri, 05 Sep 2014 07:18:02 -0700 (PDT) X-Received: by 10.52.129.165 with SMTP id nx5mr8105284vdb.25.1409926682291; Fri, 05 Sep 2014 07:18:02 -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.221.45.67 with SMTP id uj3csp89526vcb; Fri, 5 Sep 2014 07:18:01 -0700 (PDT) X-Received: by 10.70.61.162 with SMTP id q2mr22108965pdr.50.1409926681449; Fri, 05 Sep 2014 07:18:01 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ry6si4237769pab.217.2014.09.05.07.17.59 for ; Fri, 05 Sep 2014 07:17:59 -0700 (PDT) Received-SPF: none (google.com: linux-usb-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 S932609AbaIEORt (ORCPT + 2 others); Fri, 5 Sep 2014 10:17:49 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:57631 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932547AbaIEORt (ORCPT ); Fri, 5 Sep 2014 10:17:49 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id s85EHj9D014376; Fri, 5 Sep 2014 09:17:45 -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 s85EHjBe023410; Fri, 5 Sep 2014 09:17:45 -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.174.1; Fri, 5 Sep 2014 09:17:45 -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 s85EHiLi018343; Fri, 5 Sep 2014 09:17:45 -0500 From: Felipe Balbi To: Linux USB Mailing List CC: , Felipe Balbi , Subject: [PATCH] usb: dwc3: fix TRB completion when multiple TRBs are started Date: Fri, 5 Sep 2014 09:17:35 -0500 Message-ID: <1409926655-25183-1-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.0.1.563.g66f467c 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.220.179 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: , 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 e8fb231..490a6ca 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); 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); break; case DWC3_DEPEVT_XFERNOTREADY: