Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp114464rdb; Thu, 25 Jan 2024 09:43:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IFO65HqfHYMt4A40rm8Cdy3O6E5Wb/7fFwca/XadSF3fDWhflCe9iAIQQv75+LAm5q9lCWt X-Received: by 2002:ac8:7c55:0:b0:42a:5522:275c with SMTP id o21-20020ac87c55000000b0042a5522275cmr4098qtv.84.1706204620658; Thu, 25 Jan 2024 09:43:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706204620; cv=pass; d=google.com; s=arc-20160816; b=GX4aZ2db5zycMu8qZwbgOYQWnB42Yw0TFOO6M/lUBh5YJHcz0IJ1HnDY255QelNqBV LznntgN/nPazXxsaSBN+BvjNGmgsBKZriLWNUe1Ow7AJt5NrKg6znhi4K0D9dYu1AZwC YB+AGEHoVLdpSFAHx5e7QtxrAfCHQ9Fe3eD17tnVg4JEVy04jMikH+j4LF0YxVhEeWeD YK3/YFzi8Su+I9pyE7pqMacCJ6g14YYh7yZ4feayQTENCATUEqZtxmD+15tugyy7EUFx 39Zq5YSLkUcBrQd4Ig4pxNac2nNG1Ax0RqO9AuCex9xCtROPbgfjDa4JSqf0/W41vezh Ixhg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=X6U1PBhYJawz+aHB6IAFXQ+mO+hgreQcgK2NVPZ1560=; fh=i10tY6SlD6Fs/4TbsmkTOEb5kSpViDzYZye6DddrY9s=; b=nGGZvTnEHwE9bEWqBPkZJHYnHe7PNLwzNu1VFldhlDDD1QvX4sSY8O+VFOczDS+clm q4X1jL/056YmRoYVvqhlWloBeEeE0Wj4x1h6NQCX5CMY5n5nbhz6d69sNBH81L2xuPv1 lh6SvcKykyfowgB08DVvNoxJ+z8rsKilMYh1/Vls4+JIhkoTcreSAVin64+Fg77p8mk+ AzxZOG5omK6V/NbqWFUO0afSt3iZMx9z9TGOu2QPXccTFOtMsvZ2cEdDVXM3MNUsc4ps Mhz4Il3UMYGeQ6Jhog9JmxKM0q0Q9QwMNtWDQ1oCr1StP4ofxjrhxoEi2nHDQ5183Ckp AS+w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YmQDML8y; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-39049-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39049-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d14-20020ac85ace000000b0042a4a23643bsi3041429qtd.794.2024.01.25.09.43.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 09:43:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-39049-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YmQDML8y; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-39049-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39049-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 5DD651C23ED7 for ; Thu, 25 Jan 2024 17:43:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6AF2913340D; Thu, 25 Jan 2024 17:43:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YmQDML8y" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7788F1E861; Thu, 25 Jan 2024 17:43:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706204609; cv=none; b=XCZPSR/ByGaBg6LZkpnVI7DW8zXztxegvSD8MRVYBpQFgFQNwOOAM4bFYzBdl3QYFnaf5ReGaXYpVjfeC54WHlooYvgjKIzN1kRFuo2lDAjmf850iqqhQ91RfMnljIfrrZYL7L6Ty3U0bwaJWi9VDwGnPWaElgDMMuHDsTxNkFw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706204609; c=relaxed/simple; bh=H+OmZiH2ZIfXeBeTb+1jrdcr4KMaSl+7lR9ke+VrKy0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LJhew2Hf2w/qaxtfA2OBEspsUjDGIxpY2+sxP4BG8CO65N6F9DDzcfj4TglbNOU2RmIV/2oF8Zs/Nd1NX4OcQKIaxjbYKU702/4bcQFtINdz4nKwlVDJGcbA2GWHFuwueSfHfmYinikwmGFESlNmW1UflrLcN/xiN5z0uewz4gE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YmQDML8y; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49925C433C7; Thu, 25 Jan 2024 17:43:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706204608; bh=H+OmZiH2ZIfXeBeTb+1jrdcr4KMaSl+7lR9ke+VrKy0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YmQDML8ylJ+AIeU/tofb9f8a/gvkWs/jTr4AGstTX0M58zZhpf8ERfvuDHai+1WfG s1zRusVbvY7jrpEaSitbgN2mkLVMPzbsSxTlaVJv81SH7yqVREN2WhQWDb0M7V8ePv ffYY816Mm+lVBnJ/4H6Wwez0uB02mFPfWkPgzFTognv1v0hWjVWX716xX/uJhYhnPn 5uAKfRPBFU5VhPbeA29PlUi+aT+hYsR8XdPSV2I4/58AolQqGktqcNuTW4AIDuVpre /cZ3XuIwp+f8vEl5TMCkSiaTw15MOwNsQexNKij6QPaS1jJYCB/OV00lYJUo8MlS/1 gxssXUbkrTIiQ== Date: Thu, 25 Jan 2024 17:43:22 +0000 From: Conor Dooley To: Frank Li Cc: ran.wang_1@nxp.com, Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Felipe Balbi , "open list:USB SUBSYSTEM" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , open list , mark.rutland@arm.com, pku.leo@gmail.com, sergei.shtylyov@cogentembedded.com Subject: Re: [PATCH 1/2] dt-bindings: usb: dwc3: Add snps,host-vbus-glitches avoiding vbus glitch Message-ID: <20240125-appear-unclog-7da879f946e8@spud> References: <20240119213130.3147517-1-Frank.Li@nxp.com> <20240124-unclothed-dodgy-c78b1fffa752@spud> <20240124-video-lumpiness-178c4e317f5a@spud> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="DYnLHzNM1BRheBXO" Content-Disposition: inline In-Reply-To: --DYnLHzNM1BRheBXO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 24, 2024 at 02:17:22PM -0500, Frank Li wrote: > On Wed, Jan 24, 2024 at 05:59:00PM +0000, Conor Dooley wrote: > > On Wed, Jan 24, 2024 at 12:47:14PM -0500, Frank Li wrote: > > > On Wed, Jan 24, 2024 at 05:36:42PM +0000, Conor Dooley wrote: > > > > On Fri, Jan 19, 2024 at 04:31:28PM -0500, Frank Li wrote: > > > > > From: Ran Wang > > > > >=20 > > > > > 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 durin= g xhci > > > > > reset (conducted by xhci driver) for a little while and back to n= ormal. > > > > >=20 > > > > > This VBUS glitch might cause some USB devices emuration fail if k= ernel > > > > > 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 se= tting > > > > > host mode in DWC3 driver(per signal measurement result, it will b= e too > > > > > late to do it in xhci-plat.c or xhci.c). > > > > >=20 > > > > > Signed-off-by: Ran Wang > > > > > Reviewed-by: Peter Chen > > > > > Signed-off-by: Frank Li > > > > > --- > > > > > Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 7 +++++++ > > > > > 1 file changed, 7 insertions(+) > > > > >=20 > > > > > diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml= b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml > > > > > index 203a1eb66691f..dbf272b76e0b5 100644 > > > > > --- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml > > > > > +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml > > > > > @@ -273,6 +273,13 @@ properties: > > > > > with an external supply. > > > > > type: boolean > > > > > =20 > > > > > + snps,host-vbus-glitches: > > > > > + description: > > > > > + When set, power off all Root Hub ports immediately after > > > > > + setting host mode to avoid vbus (negative) glitch happen i= n later > > > > > + xhci reset. And the vbus will back to 5V automatically whe= n reset done. > >=20 > > nit: "will return to" > >=20 > > > > > + type: boolean > > > >=20 > > > > Why do we want to have a property for this at all? The commit messa= ge > > > > seems to describe a problem that's limited to specific configuratio= ns > > > > and appears to be somethng the driver should do unconditionally. > > > >=20 > > > > Could you explain why this cannot be done unconditionally please? > > >=20 > > > It depends on board design, not all system vbus can be controller by = root > > > hub port. If it is always on, it will not trigger this issue. > >=20 > > Okay, that seems reasonable to have a property for. Can you add that > > info to the commit message please? >=20 > By the way, I sent v4 at > https://lore.kernel.org/imx/20240124152525.3910311-1-Frank.Li@nxp.com/T/#t I see. > How about add below sentence? >=20 > This was only happen when PORTSC[PP} can control vbus. Needn't set it if > vbus is always on. "This can only happen when ... controls vbus, if vbus is always on, omit this property". Just a wee grammatical nitpicking. > > On another note, I like it when the property name explains why you would > > add it, rather than the thing it is trying to solve. > > Named after the disease, rather than the symptoms, if you get me. I > > tried to come up with a name here, but could not really suggest > > something good. If you can think of something, that'd be good, but don't > > stress it. >=20 > snps,host-vbus-glitches change to snps,host-vbus-glitches-quirk. I don't think adding "quirk" moves the needle. > How about use below description: >=20 > When set, power off all Root Hub ports immediately after > setting host mode to avoid vbus (negative) glitch happen in later > xhci reset. That may cause some USB devices emuration fail when kernel bo= ot > with device connected and PORTSC[PP] control vbus in board desgin. "When set, all root hub ports should be powered off immediately after enabling host mode, to avoid Vbus (negative) glitches that may happen during xHCI reset. These glitches can cause enumeration of some USB devices to fail when PORTSC[PP] controls Vbus. If Vbus is always on, omit this property." How's that? --DYnLHzNM1BRheBXO Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZbKdugAKCRB4tDGHoIJi 0rW6AP9mEQlUrIIosavfS3kjJIpwvgVbgjfh5fLTZ2BBHxvtcgEAsQ/t921axT9S 4B+qHdP7RqUk6gTi8US6ykZQjSheCgc= =rgw9 -----END PGP SIGNATURE----- --DYnLHzNM1BRheBXO--