Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7524906ybi; Wed, 5 Jun 2019 19:54:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqzuAhVjorDxe3vHMOiJc0csisKrfhnnpgJxuUUsvxUzpnzsfFQjMVewFMgmWIO/MDOlTIPe X-Received: by 2002:a63:5023:: with SMTP id e35mr1075400pgb.194.1559789644751; Wed, 05 Jun 2019 19:54:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559789644; cv=none; d=google.com; s=arc-20160816; b=MKwm/0UJ4brizjoPqOtjE8Zc1IBdkLvtjYMwEVM6EKW+/e1dRu77ZX1LxS0sYHt0M2 HoHaKl8SoCu+SNfmoEhdMGvdaBfM7dDpQum2maI5lHifHfYh9SvUgTLdO6Vd+p+kib+0 ISblDrOo9mDFVePHbqwp0EYxwyjoQ/NYioELQjyN7Z6/t6+YARnQOlkuM3qOq4Waqpnm WPP1Kmn0lVbHz4p8Zg1hCX8eGmr39/4rGTSnXSnEKuV3/ATOwDgcMNd+VRREr3CndMpb UiOgiEVzXrNbSfFN9nBHUStQL4+keDxg+E6IlHCqnHraSN8Ey12NcbXRD0BKGV6hRXv/ 5n5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=GoDR565I9razHTk08kWWmBWZQCLnvUTFbw3sjEOdRVc=; b=lkOuDD8aLpnCXKzk41yu3z/KrCJiHV7pZiE6w5fcpTDn0ECz7IjJPzj4zfaz+S6R+t fduKdOvb7JkMdCpeZnOgwbgZAF7Qh48avHB+5aByF2LZJp0WevyTHFSqv/hzPtGEBCwj 8lYnEj0PUbHQ1/wrOYVvFNGL+nuoFiME/QxMZWYSzHb1K4ymsJvbzdXj5FTlmol6BOn4 wIcWmozc3NWNqoSSQ0f5goLBQm4ve4ga75gM6VF06lWhtQNX4jQfSvQfxAGs9CM2WMk0 gUhXuYGlTHjAl3fsqgn71nOm6ziCvxlG3t+p5gSIhX1eCWAWCa70CaC/3/s7hQMIBGoI graQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u18si425756plq.345.2019.06.05.19.53.47; Wed, 05 Jun 2019 19:54:04 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726715AbfFFCwl (ORCPT + 99 others); Wed, 5 Jun 2019 22:52:41 -0400 Received: from inva021.nxp.com ([92.121.34.21]:54880 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726427AbfFFCwl (ORCPT ); Wed, 5 Jun 2019 22:52:41 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 7FADB200997; Thu, 6 Jun 2019 04:52:38 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 6058B20098C; Thu, 6 Jun 2019 04:52:34 +0200 (CEST) Received: from localhost.localdomain (mega.ap.freescale.net [10.192.208.232]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 01B76402A6; Thu, 6 Jun 2019 10:52:28 +0800 (SGT) From: Ran Wang To: Greg Kroah-Hartman , Rob Herring , Mark Rutland , Felipe Balbi , Yang Li Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Ran Wang Subject: [RESEND][PATCH v3 1/2] usb: dwc3: Add avoiding vbus glitch happen during xhci reset Date: Thu, 6 Jun 2019 10:54:17 +0800 Message-Id: <20190606025418.26313-1-ran.wang_1@nxp.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When DWC3 is set to host mode by programming register DWC3_GCTL, VBUS (or its control signal) will turn on immediately on related Root Hub ports. Then the VBUS will be de-asserted for a little while during xhci reset (conducted by xhci driver) for a little while and back to normal. This VBUS glitch might cause some USB devices emuration fail if kernel boot with them connected. One SW workaround which can fix this is to program all PORTSC[PP] to 0 to turn off VBUS immediately after setting host mode in DWC3 driver(per signal measurement result, it will be too late to do it in xhci-plat.c or xhci.c). Signed-off-by: Ran Wang Reviewed-by: Rob Herring --- Changes in v3: - None Changes in v2: - Correct typos - Shorten the name to snps,host-vbus-glitches Documentation/devicetree/bindings/usb/dwc3.txt | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt index 8e5265e..453f562 100644 --- a/Documentation/devicetree/bindings/usb/dwc3.txt +++ b/Documentation/devicetree/bindings/usb/dwc3.txt @@ -106,6 +106,9 @@ Optional properties: When just one value, which means INCRX burst mode enabled. When more than one value, which means undefined length INCR burst type enabled. The values can be 1, 4, 8, 16, 32, 64, 128 and 256. + - snps,host-vbus-glitches: Power off all Root Hub ports immediately after + setting host mode to avoid vbus (negative) glitch happen in later + xhci reset. And the vbus will back to 5V automatically when reset done. - in addition all properties from usb-xhci.txt from the current directory are supported as well -- 1.7.1