Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7414694imu; Tue, 22 Jan 2019 05:47:25 -0800 (PST) X-Google-Smtp-Source: ALg8bN454u4u8P4fHMPzmO6lP0JxMZN9dor7UBRPzv27q9ydjncTIdxj7VoE66FmHD1kcR/SBKB2 X-Received: by 2002:a62:cec6:: with SMTP id y189mr34768365pfg.100.1548164845139; Tue, 22 Jan 2019 05:47:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548164845; cv=none; d=google.com; s=arc-20160816; b=aGy7oTnhe9F+PRadSFeZ9SfrrxqUPH0DPEQ8nD6JTkKBW1NBLAloPpMxLYmCsNt5cd NY68hXJ6RQrhbuhEIcqJeKnz3hlol1MZ58c1HqoPee5tlbmVsGX1NufXGgJ1ncqHouRh 6IQGO8u18p4emy5uv3hXWYAvPKtJOeHcmqoRn4ICLmLLP/kwC6M078acNsMuiMPRVcDg p1hVs4ThNcbSVjC6S2O585GEceu4dJfKDxlHBZROzOt6GE+XnAN8rxv0ObmXd96ti5Dm lPhPM8jSgjUWVf3aIhl57q4u9oAjt1N+auDhhvo+asj4bERraqiSoKMFBpX+IiDMSw3b /Vwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=EGF8iRorLPkPAxfSepQ9OFK6CrvXHCrn9ci8NouUAWs=; b=A31t1Fg+t5WTJhmoCglEk0OZiNFpvw7EtQ/JXQQ7QLF/g8rsb4l2NeVeL3vBhvBHAK 8YTFMKXSzIrTTeLvZoA7mvcMAu3xvX3GMqGEKiJQHi4aDauw3yVgMOaLcA9cI3BpT/pH /B3QsX7AHkF+RmLM/7aZ31sEDz+GP3HbzMNOv/kHDw8j8cmsdU61dUczD+Fsh2j2oqrm 3ouSojNnmvTb+nwpCNwR4RftsnZ8gTcTJ7q77I3XRw4Tudm57lPSYfK3T4MUZDD3fL+u 9bLGW1bjbVdv7Imu0JoMtsUui03AmX2fyfDbuakzx08wCkmY0CLmeRNDQQRR6CgYZvbh 4T2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=h75TWyvJ; 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=pass (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 k35si14927003pgm.225.2019.01.22.05.47.09; Tue, 22 Jan 2019 05:47:25 -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; dkim=pass header.i=@kernel.org header.s=default header.b=h75TWyvJ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728616AbfAVNpV (ORCPT + 99 others); Tue, 22 Jan 2019 08:45:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:35098 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728463AbfAVNpU (ORCPT ); Tue, 22 Jan 2019 08:45:20 -0500 Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com [209.85.160.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E889B217D6; Tue, 22 Jan 2019 13:45:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548164719; bh=5/j3u3sZlwdpjGBXUtougPs3U/DWZfx6ioM/i2tKqpE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=h75TWyvJ6pAqKCETd70uYMwTRU8oQ/JAjyStfqw8CZpPckhG5uaK81PxttYNBydca arhW1h4dFLQ8CnkSrHNZ/Cc0yjisfmnNFtfJST8ZySOp1kVGpTMRezP1AfoOgR64Nb zI3mAaCMjmG2tPIjgZrZuy10n466ZSSkr5lBFkdk= Received: by mail-qt1-f169.google.com with SMTP id y20so27496863qtm.13; Tue, 22 Jan 2019 05:45:18 -0800 (PST) X-Gm-Message-State: AJcUukc0PZ2BFLHU/VqDVXJWXxYzLkJS8UdjrTZiP2S/hFjabvdIeAdK JYwBf2pyEGwUZ4EDk4k/cAO4Omsk9cbB+2bwog== X-Received: by 2002:aed:29a6:: with SMTP id o35mr30262023qtd.257.1548164718107; Tue, 22 Jan 2019 05:45:18 -0800 (PST) MIME-Version: 1.0 References: <20190116064820.20007-1-ran.wang_1@nxp.com> <20190116064820.20007-2-ran.wang_1@nxp.com> <20190122010310.GA5165@bogus> In-Reply-To: From: Rob Herring Date: Tue, 22 Jan 2019 07:45:07 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] usb: dwc3: Add avoiding vbus glitch happen during xhci reset 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" 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 On Mon, Jan 21, 2019 at 8:38 PM Ran Wang wrote: > > Hi Rob, > > On January 22, 2019 09:03, Rob Herring wrote: > > > > 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/ > > Yes, will fix it in next version. > > > > (or its control signal) will on immediately on related Root Hub ports. > > > > /will on/will turn on/ > > Got it. Thanks. > > > > 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. > > Sorry, not quite get your point here? Actually I have discussed with Soc design guys > and Felipe, it seems to be DWC3 native behavior rather than SoC specific issue. > https://lkml.org/lkml/2018/11/23/387 > https://lkml.org/lkml/2018/12/12/140 > > I think there could be 2 reasons why we got no report for a long time till now: > 1. Most USB devices are not so sensitive to this VBUS glitch, they would works fine. > 2. A proper VBUS pump circuit design can successfully filter this glitch out. I have > confirmed this with scope, which means some platforms might resolve issue in > this way already (some might not, of cause). > > > Does this even need to be conditional? What would be the harm in doing > > this unconditionally for all DWC3 hosts? > > From the logic level, I don't see a harm to DWC3 hosts if unconditionally apply this. > However, since this is not a only solution (can fix it in HW way), I prefer to let it > controlled by property in DTS node for those questionable board already existing > in market. Okay, sounds fine. I would shorten the name a bit: snps,host-vbus-glitches Rob