Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6824290imu; Mon, 21 Jan 2019 17:05:21 -0800 (PST) X-Google-Smtp-Source: ALg8bN7XWy5wMH7/KI8noOTmHIbUQTFUJpYFzmUZvDdRie0kMbOIa57QEiPf2MzDOBZUVExe+4ij X-Received: by 2002:a17:902:2f03:: with SMTP id s3mr31499006plb.277.1548119121583; Mon, 21 Jan 2019 17:05:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548119121; cv=none; d=google.com; s=arc-20160816; b=r1MSJQtDR3eMzeP9HjEJepr9PTZrBiBMITryuar0u7SixV9qroNVYQnQIrhOWANtt7 wqdZ8M+qbXEBYiDKnJyZqAjAJZH1rqviAybLzdk0URl5T8mD9rValKDVYgdH0PGG8o4r XJ6Xv1gN1Qq4GoFupV8qBJZfdUVi9DY6rkpKbpTxUkDvD1YAeq42vOp1cnQW+wNdbqWg +kbt9/L2IiJPDagCUYzr5oJ0A0ljF0iqQWDZNjBpksmQUYBecmChOBl74A+Puye0n5NL sdCi8nFTbA+Oe8fSDkE9e0bfHROYLaXtR8RwH/8cT0o9CCqUMqB3dAOFPPEZvfV+V7pf 3iJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=vLRN6zdO2xPeyW7SDGtM/z29346KS1SxytgAwhX1KqA=; b=irSn+I1XqcoDl2W3dNhUN/SJQYij/XfpMrQAMYgH9rIk4SqsNBIxCFSlVrMM6VXW8c arluGIMjlAZi6dl9CLU4248fL1o5n+lyW4CaGMG4JSM0rDWFPHZFe8EbUZm4qXfJIJEb xkSOURv/hXGPLOOZ8nkFCjBvzmFTGTLf4X3MKQvkReQnIxl1+syv3GXVum4HBczUjfcq jaGcENJrRSDVNNAc7H7rKbuzHIREAcPGhFJ1EaehbyVzIk7tmlRu3UuUBEtHdOVWojSG 7WItboBrTqO1oKX9rPjbtZ3NrSScNFZqzhn3fKQzPOoa2kkW3cmL72xDW1Vfriodom9k +VWA== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c132si13873450pga.597.2019.01.21.17.05.05; Mon, 21 Jan 2019 17:05:21 -0800 (PST) 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726798AbfAVBDN (ORCPT + 99 others); Mon, 21 Jan 2019 20:03:13 -0500 Received: from mail-ot1-f66.google.com ([209.85.210.66]:33722 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725896AbfAVBDM (ORCPT ); Mon, 21 Jan 2019 20:03:12 -0500 Received: by mail-ot1-f66.google.com with SMTP id i20so22246449otl.0; Mon, 21 Jan 2019 17:03:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=vLRN6zdO2xPeyW7SDGtM/z29346KS1SxytgAwhX1KqA=; b=OSCaUz7UsSQQi14k4Kk2CrVtxHsB1Ykxvmv+q7iCgpfRh+GVtmIbQzpptAclpSgnaE yQnzxpNe6NvoGCzgksL1JjZKE9AEU5O+C/FwJMULe2whqvyYoZX4MPWSQtN1m8CPX9aa 0d8YWEmUqwEzBd8JyxfucasgLTgevAXo1pUKJBkc1/9vwJOx7l7WKdX1wZtZRplGyb1P 3YCuaXZ90/3Bpx+0KZDuMDUrY9r26KOYklD6Fk31mxtdJ+7npPIwfQDONm+eqgJfiStK ncDCFDOTOo3qd3eYM/B0wgD3uQOkLP7UgoEX2L9noHDyDfl5BviPYnAVW8DlpQb1dLfl yOtA== X-Gm-Message-State: AJcUukdLSeOMkxqTXUTEI1u0yLC4b4en0TxWvXeLMof8ymz/kMJUOsE1 ejv/9HkUs4geBTomB+d6fw== X-Received: by 2002:a9d:325:: with SMTP id 34mr10355389otv.94.1548118991621; Mon, 21 Jan 2019 17:03:11 -0800 (PST) Received: from localhost (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.gmail.com with ESMTPSA id i12sm5946004otr.74.2019.01.21.17.03.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Jan 2019 17:03:10 -0800 (PST) Date: Mon, 21 Jan 2019 19:03:10 -0600 From: Rob Herring To: Ran Wang Cc: Greg Kroah-Hartman , Mark Rutland , Felipe Balbi , "linux-usb@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 1/2] usb: dwc3: Add avoiding vbus glitch happen during xhci reset Message-ID: <20190122010310.GA5165@bogus> References: <20190116064820.20007-1-ran.wang_1@nxp.com> <20190116064820.20007-2-ran.wang_1@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190116064820.20007-2-ran.wang_1@nxp.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 16, 2019 at 06:48:06AM +0000, Ran Wang wrote: > When DWC3 is set to host mode by programming register DWC3_GCTL, VUBS s/VUBS/VBUS/ > (or its control signal) will on immediately on related Root Hub ports. /will on/will turn on/ > Then the VUBS 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 > --- > 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..dadb530 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,avoid-vbus-glitch-when-set-host: 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. Can't you imply this from the compatible string. You should have an SoC specific compatible. Does this even need to be conditional? What would be the harm in doing this unconditionally for all DWC3 hosts? Rob