From patchwork Mon Apr 21 15:56: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: 28709 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 97D422032B for ; Mon, 21 Apr 2014 15:59:26 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id wn1sf15244899obc.5 for ; Mon, 21 Apr 2014 08:59:26 -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=FE2cj8yZCrvUCLG7SVoXQDxt/2BHGjlAs2tMOIXmSp4=; b=NYVN0XAxWUNxLD23b9pKzEuAQJA0O8ugtfvGLRNJeVxtdoYuxNUo9UrK+gXBLi+YQL l64UO/OEFvjjHuMuTLm0+b/HwWzq6UxRJoFG3EuxvvQzZ3qhUQXQP0+9n2RdLxgqgJfE 7Ujp8J0oPBdyCNM9w04F+ARrS8XZINrylD6W1uWFW9Dng5D5XVY5GadmamTqtOAq1AkA nywPOFBxMFUrU4+AkfK/4L5HAskwjcAmVLAFxpoVG9IoMlFWHT42FhlZE/yPeUIQ+Lpc n5hfTWqvcQQb2RtdPP1fPWhNxuhLeKdupeOTbsi6qBnFFmmwYvKJLUyDY683LmDo+j5M 3mSA== X-Gm-Message-State: ALoCoQkcSE5zWwu076vqpKRiDD7qSYoSI87DH+l0pM+p2vJw9sqUgY+1rxgfWXrVrZcZV1rUkIqR X-Received: by 10.182.22.133 with SMTP id d5mr19816914obf.27.1398095966187; Mon, 21 Apr 2014 08:59:26 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.22.208 with SMTP id 74ls1996904qgn.18.gmail; Mon, 21 Apr 2014 08:59:26 -0700 (PDT) X-Received: by 10.58.123.71 with SMTP id ly7mr34978351veb.11.1398095966088; Mon, 21 Apr 2014 08:59:26 -0700 (PDT) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id la9si6304741veb.200.2014.04.21.08.59.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 21 Apr 2014 08:59:26 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.173; Received: by mail-ve0-f173.google.com with SMTP id oy12so8083455veb.18 for ; Mon, 21 Apr 2014 08:59:26 -0700 (PDT) X-Received: by 10.52.37.130 with SMTP id y2mr588521vdj.38.1398095965980; Mon, 21 Apr 2014 08:59:25 -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.220.221.72 with SMTP id ib8csp300519vcb; Mon, 21 Apr 2014 08:59:25 -0700 (PDT) X-Received: by 10.69.2.2 with SMTP id bk2mr38850964pbd.75.1398095964756; Mon, 21 Apr 2014 08:59:24 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id se7si21089446pbb.96.2014.04.21.08.59.24; Mon, 21 Apr 2014 08:59:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-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 S1751363AbaDUP7S (ORCPT + 5 others); Mon, 21 Apr 2014 11:59:18 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:43399 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750772AbaDUP7R (ORCPT ); Mon, 21 Apr 2014 11:59:17 -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 s3LFxDTx027199; Mon, 21 Apr 2014 10:59:13 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s3LFxDdj020688; Mon, 21 Apr 2014 10:59:13 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.174.1; Mon, 21 Apr 2014 10:59:13 -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 s3LFxCnn011893; Mon, 21 Apr 2014 10:59:13 -0500 From: Felipe Balbi To: Linux USB Mailing List CC: Linux OMAP Mailing List , , Tony Lindgren , Felipe Balbi , Subject: [PATCH 01/10] usb: dwc3: gadget: clear stall when disabling endpoint Date: Mon, 21 Apr 2014 10:56:43 -0500 Message-ID: <1398095812-14222-2-git-send-email-balbi@ti.com> X-Mailer: git-send-email 1.9.2.459.g68773ac In-Reply-To: <1398095812-14222-1-git-send-email-balbi@ti.com> References: <1398095812-14222-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-omap@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=neutral (google.com: 209.85.128.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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: , so it seems like DWC3 IP doesn't clear stalls automatically when we disable an endpoint, because of that, we _must_ make sure stalls are cleared before clearing the proper bit in DALEPENA register. Cc: # v3.4+ Reported-by: Johannes Stezenbach Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index a740eac..f0dc0ee 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -608,6 +608,10 @@ static int __dwc3_gadget_ep_disable(struct dwc3_ep *dep) dwc3_remove_requests(dwc, dep); + /* make sure HW endpoint isn't stalled */ + if (dep->flags & DWC3_EP_STALL) + __dwc3_gadget_ep_set_halt(dep, 0); + reg = dwc3_readl(dwc->regs, DWC3_DALEPENA); reg &= ~DWC3_DALEPENA_EP(dep->number); dwc3_writel(dwc->regs, DWC3_DALEPENA, reg);