From patchwork Mon Jun 30 11:52:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 32699 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f72.google.com (mail-oa0-f72.google.com [209.85.219.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A2D64203C0 for ; Mon, 30 Jun 2014 11:54:36 +0000 (UTC) Received: by mail-oa0-f72.google.com with SMTP id eb12sf52578373oac.7 for ; Mon, 30 Jun 2014 04:54:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=xDFIKjAAVq2BzxTOgzLYiJvQ9trlYTd8aYMEDR0quaM=; b=dobEc6STnFDTSQtntYpHvy8xMjGAJ/nJLUlPN4DmW9DtTE9ipDesggmYXSRtY1HvM0 y70IFIWRcRT9cnvRujj9iys0bpd5CMvtiUAvkXheKdOXXiBdgd7qxwpdYOVRcftyYC9W yyQ7rloM62De297efiqYfdjxzYXg3YT+lLeh+7H8+qUpBmsfI75FCiyvrAi8h/YiJ2XW NZt+wBJuxYnBzG/TsZIt+rWrRG9FGfZha461A7OGPjl61QiIlZnlX1nRLiDZ7YYa+ADh BZMWVkfvxcZPWRdEzGUePqPzH6QaQnRxNhf4Iypwt8tTyQcUuBn4T4Adwh5tS415eHT1 lVpw== X-Gm-Message-State: ALoCoQlLSeICARTNB7c4mQjLzL5uCSwhHg3mQv7vd2F+IJH86NR7KCrG78Hc2uEKCMK+ql4H+1fh X-Received: by 10.182.43.196 with SMTP id y4mr20726825obl.35.1404129276296; Mon, 30 Jun 2014 04:54:36 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.106.99 with SMTP id d90ls1456871qgf.57.gmail; Mon, 30 Jun 2014 04:54:36 -0700 (PDT) X-Received: by 10.52.252.193 with SMTP id zu1mr31526919vdc.7.1404129276177; Mon, 30 Jun 2014 04:54:36 -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 qr19si8603905vdb.86.2014.06.30.04.54.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 30 Jun 2014 04:54:36 -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 id10so7315164vcb.24 for ; Mon, 30 Jun 2014 04:54:36 -0700 (PDT) X-Received: by 10.52.103.97 with SMTP id fv1mr1507598vdb.42.1404129276092; Mon, 30 Jun 2014 04:54:36 -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.37.5 with SMTP id tc5csp131179vcb; Mon, 30 Jun 2014 04:54:35 -0700 (PDT) X-Received: by 10.66.236.6 with SMTP id uq6mr31321477pac.24.1404129275284; Mon, 30 Jun 2014 04:54:35 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bc4si22922560pbb.71.2014.06.30.04.54.34; Mon, 30 Jun 2014 04:54:34 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-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 S1755122AbaF3Ly0 (ORCPT + 27 others); Mon, 30 Jun 2014 07:54:26 -0400 Received: from ip4-83-240-18-248.cust.nbox.cz ([83.240.18.248]:52138 "EHLO ip4-83-240-18-248.cust.nbox.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754036AbaF3Lx0 (ORCPT ); Mon, 30 Jun 2014 07:53:26 -0400 Received: from ku by ip4-83-240-18-248.cust.nbox.cz with local (Exim 4.80.1) (envelope-from ) id 1X1a9E-0000km-Qe; Mon, 30 Jun 2014 13:53:24 +0200 From: Jiri Slaby To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Felipe Balbi , Jiri Slaby Subject: [PATCH 3.12 106/181] usb: dwc3: gadget: clear stall when disabling endpoint Date: Mon, 30 Jun 2014 13:52:07 +0200 Message-Id: X-Mailer: git-send-email 2.0.0 In-Reply-To: <61844d8e25eb8899b0836afa9796fa239db80f1f.1404128997.git.jslaby@suse.cz> References: <61844d8e25eb8899b0836afa9796fa239db80f1f.1404128997.git.jslaby@suse.cz> In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linux-kernel-owner@vger.kernel.org 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: , From: Felipe Balbi 3.12-stable review patch. If anyone has any objections, please let me know. =============== commit 687ef9817df7ed960d14575b9033dde3d04631fe upstream. 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. Reported-by: Johannes Stezenbach Signed-off-by: Felipe Balbi Signed-off-by: Jiri Slaby --- 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 02e44fcaf205..c37da0c9a076 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -586,6 +586,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);