Received: by 10.213.65.68 with SMTP id h4csp1765290imn; Mon, 19 Mar 2018 12:38:15 -0700 (PDT) X-Google-Smtp-Source: AG47ELvXv36oVbav4yBofqyTREWxainFpfZwb4oNKLZu6qfoEF3uDLRxzxAIAJ2mCOhHcivttUxi X-Received: by 2002:a17:902:d892:: with SMTP id b18-v6mr13838242plz.241.1521488295291; Mon, 19 Mar 2018 12:38:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521488295; cv=none; d=google.com; s=arc-20160816; b=wbgXLXCnx2rOWp/0WQlpLKT+kHSzeJOXIXVs6Rxt22kUb60WNRpKbS4A0zoxmxKGP/ 1jSSgQnC3tgOFHSo7kwd86kf2IRUmqzPnliaw84/IVL+jcsqdLAY5kfduJHasB/Z15e7 7W6FrPGFKnWrw2XX8DJVZzxsp/8umBVTBAxrQyHDSD+aF5KZomJcOI99j1wdJ56dfiu4 h1Ir4TPnVgGb91aJuKZFPv4vU8KZ8DYUl95GGp9H7VBQbtLVC+RNTjUxSBMn8zqrgocC MgLzUvNpPF1q8rF9FbQdDB89xO67rGU/5yyN/OIrK16BukP1nWXrrxhshIjzwCJVILPK bc4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=SQnHc3Q3PTfHcn27IqkRnWWjs5B2m0p2jU3o8oeQ3PM=; b=xjI+rnF9qmNBrFktMdCVpNDPOWXspzQsoe9uFhAniwNn+QNi8iMuBEynxoq2n/T9bw EOEU7XjjTuK3eM2yH2xS2lEQlWVogLPzufb12zPduyd482wyegIS2jPC5Bie4h6x2E6G 3u2d1ZteUcdxGrpcyuF3J8IpEiakgf33nu35oMHtpevGA82NuAg67eyWxIC9+FkB0LVq M/aIvCWHd/ztDgI3nKC34+ggrMW3U1pmcw9Jcs8WMq8g7FnsJR7LTDlJM42oawZaZkoR lvFl2Hm5MxptnT58dHnN5nEAKSGh6vh32m/FRRThJFK4vdJqgFx0Kx3nry9ZEXXQton7 ZNPA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c1-v6si547466pla.34.2018.03.19.12.38.01; Mon, 19 Mar 2018 12:38:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967979AbeCSTg2 (ORCPT + 99 others); Mon, 19 Mar 2018 15:36:28 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:48526 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031259AbeCSSWZ (ORCPT ); Mon, 19 Mar 2018 14:22:25 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 3AD0C128F; Mon, 19 Mar 2018 18:22:24 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Felipe Balbi , Sasha Levin Subject: [PATCH 4.9 066/241] usb: dwc3: make sure UX_EXIT_PX is cleared Date: Mon, 19 Mar 2018 19:05:31 +0100 Message-Id: <20180319180753.935840605@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180751.172155436@linuxfoundation.org> References: <20180319180751.172155436@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Felipe Balbi [ Upstream commit 1966b8657d058ecb95031809b607bf3fd1e01c10 ] This bit is only supposed to be used with known buggy PHYs, however some platforms might erroneously set it. In order to avoid it, let's make sure this bit is always cleared. If some PHY needs this, we will need to add a quirk flag. Signed-off-by: Felipe Balbi Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/usb/dwc3/core.c | 6 ++++++ drivers/usb/dwc3/core.h | 1 + 2 files changed, 7 insertions(+) --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -464,6 +464,12 @@ static int dwc3_phy_setup(struct dwc3 *d reg = dwc3_readl(dwc->regs, DWC3_GUSB3PIPECTL(0)); /* + * Make sure UX_EXIT_PX is cleared as that causes issues with some + * PHYs. Also, this bit is not supposed to be used in normal operation. + */ + reg &= ~DWC3_GUSB3PIPECTL_UX_EXIT_PX; + + /* * Above 1.94a, it is recommended to set DWC3_GUSB3PIPECTL_SUSPHY * to '0' during coreConsultant configuration. So default value * will be '0' when the core is reset. Application needs to set it --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -223,6 +223,7 @@ #define DWC3_GUSB3PIPECTL_PHYSOFTRST (1 << 31) #define DWC3_GUSB3PIPECTL_U2SSINP3OK (1 << 29) #define DWC3_GUSB3PIPECTL_DISRXDETINP3 (1 << 28) +#define DWC3_GUSB3PIPECTL_UX_EXIT_PX (1 << 27) #define DWC3_GUSB3PIPECTL_REQP1P2P3 (1 << 24) #define DWC3_GUSB3PIPECTL_DEP1P2P3(n) ((n) << 19) #define DWC3_GUSB3PIPECTL_DEP1P2P3_MASK DWC3_GUSB3PIPECTL_DEP1P2P3(7)