[From nobody Thu Jun 25 05:54:41 2020
Received: from mail-he1eur01on0624.outbound.protection.outlook.com
 ([2a01:111:f400:fe1e::624]
 helo=EUR01-HE1-obe.outbound.protection.outlook.com)
 by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux))
 id 1fSP0n-0001yb-Fk
 for openwrt-devel@lists.openwrt.org; Mon, 11 Jun 2018 15:45:43 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=darbyshire-bryant.me.uk; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=xNQeQYyfpvkF9MpudYQohMmAXEBJ99iHJywYtRnbOfU=;
 b=jrZFqnf50c++M8eQMvCsKQ4JCUU6QpMaN+rrIcTdQBG2c36SWVFHeww+ar3BD1Zh5EG4C9CnV5d35AU+rfMZSVjYIH8aJ9uRqYht8QTbQbtvSIobvc7kEaK06y0xergaPRbY6LxvgxU85PdBaGiQU70Wk6YcYFD4KbVlusgBrn8=
Received: from VI1PR07MB4254.eurprd07.prod.outlook.com (20.176.6.147) by
 VI1PR07MB1053.eurprd07.prod.outlook.com (10.161.111.145) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.863.6; Mon, 11 Jun 2018 15:45:24 +0000
Received: from VI1PR07MB4254.eurprd07.prod.outlook.com
 ([fe80::2d37:3474:cf1e:b21c]) by VI1PR07MB4254.eurprd07.prod.outlook.com
 ([fe80::2d37:3474:cf1e:b21c%4]) with mapi id 15.20.0863.010; Mon, 11 Jun 2018
 15:45:23 +0000
From: Kevin Darbyshire-Bryant &lt;kevin@darbyshire-bryant.me.uk&gt;
To: Mathias Kresin &lt;dev@kresin.me&gt;
CC: &quot;openwrt-devel@lists.openwrt.org&quot; &lt;openwrt-devel@lists.openwrt.org&gt;
Subject: Re: [PATCH] ramips: mir3g: reduce usb power flapping at boot
Thread-Topic: [PATCH] ramips: mir3g: reduce usb power flapping at boot
Thread-Index: AQHT/1kJdqFXOpTsRUyXxzbRiS0jf6RbKi8AgAANiAA=
Date: Mon, 11 Jun 2018 15:45:23 +0000
Message-ID: &lt;0A89B56F-8B28-4FAB-8C60-891D0D70D81D@darbyshire-bryant.me.uk&gt;
References: &lt;20180608184534.43084-1-ldir@darbyshire-bryant.me.uk&gt;
 &lt;dae711da-a7dc-a157-c698-ed2840f1600d@kresin.me&gt;
In-Reply-To: &lt;dae711da-a7dc-a157-c698-ed2840f1600d@kresin.me&gt;
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [2a02:c7f:1231:2000::dc83]
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1; VI1PR07MB1053;
 7:Q9BA/yPEGJ7VsnCxRzxIrJeZq2hyEpBK5sVORVO2d+zF4TZkcWdWo1ukyAFtv08OOxJfzuePmmIGjF6ks1fGmMqHvleof3+6VWtlGjF1GgGwvIMv7CP4Xg8iXMZfdfWGkNUZa0CldNYdb5KrxDzjBXHtU2VawnSu6Zjx9+kjEofa0TijJND3sV6MiMY4cbFvc27bGXbn3px2fG1xQqniC4Rz6WI0mcpxN5l8gxP0+dV9PgMYlCqHbSjOM6cBsojt
x-ms-exchange-antispam-srfa-diagnostics: SOS;
x-microsoft-antispam: UriScan:; BCL:0; PCL:0;
 RULEID:(7020095)(4652020)(7021125)(5600026)(4534165)(7022125)(4603075)(4627221)(201702281549075)(7048125)(7024125)(7027125)(7028125)(7023125)(2017052603328)(7153060)(7193020);
 SRVR:VI1PR07MB1053; 
x-ms-traffictypediagnostic: VI1PR07MB1053:
authentication-results: spf=none (sender IP is )
 smtp.mailfrom=kevin@darbyshire-bryant.me.uk; 
x-microsoft-antispam-prvs: &lt;VI1PR07MB10531934601F1BA17B0B03DFA5780@VI1PR07MB1053.eurprd07.prod.outlook.com&gt;
x-exchange-antispam-report-test: UriScan:(166708455590820);
x-ms-exchange-senderadcheck: 1
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0;
 RULEID:(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(3231254)(944501410)(52105095)(149027)(150027)(6041310)(2016111802025)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(6072148)(6043046)(201708071742011)(7699016);
 SRVR:VI1PR07MB1053; BCL:0; PCL:0; RULEID:; SRVR:VI1PR07MB1053; 
x-forefront-prvs: 070092A9D3
x-forefront-antispam-report: SFV:NSPM;
 SFS:(10009020)(346002)(39380400002)(366004)(396003)(39830400003)(376002)(199004)(189003)(86362001)(6246003)(478600001)(2616005)(99286004)(186003)(966005)(6916009)(6506007)(36756003)(2900100001)(11346002)(46003)(53546011)(102836004)(83716003)(486006)(59450400001)(476003)(76176011)(82746002)(25786009)(33656002)(6486002)(6306002)(4326008)(106356001)(105586002)(6512007)(5250100002)(316002)(97736004)(229853002)(81156014)(53936002)(3660700001)(2906002)(6116002)(68736007)(8676002)(14454004)(446003)(81166006)(5660300001)(305945005)(74482002)(3280700002)(6436002)(8936002)(7736002)(32563001);
 DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR07MB1053;
 H:VI1PR07MB4254.eurprd07.prod.outlook.com; FPR:; SPF:None; LANG:en;
 PTR:InfoNoRecords; A:1; MX:1; 
received-spf: None (protection.outlook.com: darbyshire-bryant.me.uk does not
 designate permitted sender hosts)
x-microsoft-antispam-message-info: Sy+RaNAqp4Ivr4W+Gn1+bwOmO05GaoMfCWPt/xDRsJ/y6nJFCj1SQHHCqoIxKqgOB0Fbn9EKepqAPeCXynHvpFmKXUVxXgKGVCFuzJFZMen3lPxqC3x/TOe0ghEwml01+ZYX0tVVIK+0OtzIFQl4xTHedOrVkADuvg4yrG16N2LOR66gnjP3TrcSwU+TGcjF
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: text/plain; charset=&quot;us-ascii&quot;
Content-ID: &lt;9A03D515AE1818439BF45FA22F435F4F@eurprd07.prod.outlook.com&gt;
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Office365-Filtering-Correlation-Id: 3ecfc51c-25b9-4343-807f-08d5cfb2586f
X-OriginatorOrg: darbyshire-bryant.me.uk
X-MS-Exchange-CrossTenant-Network-Message-Id: 3ecfc51c-25b9-4343-807f-08d5cfb2586f
X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jun 2018 15:45:23.5442 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 9151708b-c553-406f-8e56-694f435154a4
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB1053
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 
X-CRM114-CacheID: sfid-20180611_084541_786587_BE693EC3 
X-CRM114-Status: GOOD (  12.70  )
X-Spam-Score: -0.1 (/)
X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary:
 Content analysis details:   (-0.1 points)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at http://www.dnswl.org/, no
 trust [2a01:111:f400:fe1e:0:0:0:624 listed in] [list.dnswl.org]
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
 0.1 DKIM_SIGNED            Message has a DKIM or DK signature,
 not necessarily valid
 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's
 domain



&gt; On 11 Jun 2018, at 15:56, Mathias Kresin &lt;dev@kresin.me&gt; wrote:
&gt;=20
&gt; 08.06.2018 20:45, Kevin Darbyshire-Bryant:
&gt;&gt; Define USB port power as set on by bootloader (which it is)  The power
&gt;&gt; gets cycled at kernel boot, but by defining as 'regulator-boot-on'
&gt;&gt; reduces the power off to power on at driver initial load &amp; setup from
&gt;&gt; around 5 seconds to around 2 seconds.
&gt;&gt; Signed-off-by: Kevin Darbyshire-Bryant &lt;ldir@darbyshire-bryant.me.uk&gt;
&gt;&gt; ---
&gt;&gt;  target/linux/ramips/dts/MIR3G.dts | 1 +
&gt;&gt;  1 file changed, 1 insertion(+)
&gt;&gt; diff --git a/target/linux/ramips/dts/MIR3G.dts b/target/linux/ramips/dts=
/MIR3G.dts
&gt;&gt; index 44dfc1796c..1ca085e6c4 100644
&gt;&gt; --- a/target/linux/ramips/dts/MIR3G.dts
&gt;&gt; +++ b/target/linux/ramips/dts/MIR3G.dts
&gt;&gt; @@ -72,6 +72,7 @@
&gt;&gt;  		regulator-min-microvolt =3D &lt;5000000&gt;;
&gt;&gt;  		regulator-max-microvolt =3D &lt;5000000&gt;;
&gt;&gt;  		gpio =3D &lt;&amp;gpio0 12 GPIO_ACTIVE_HIGH&gt;;
&gt;&gt; +		regulator-boot-on;
&gt;&gt;  		enable-active-high;
&gt;&gt;  	};
&gt;=20
&gt; NAK on this one.
&gt;=20
&gt; Following our conversation on IRC, I had a look at the fixed regulator co=
de to see what it really does. By default the regulator is disabled during =
driver load[0]. The &quot;regulator-boot-on&quot; inverts the logic and enables the r=
egulator while loading the fixed regulator driver.
&gt;=20
&gt; In my opinion, enabling the fixed regulator unconditionally on boot contr=
adicts your initial &quot;switch to fixed regulator&quot; patch. Without the &quot;regulat=
or-boot-on&quot;, the GPIO is pulled LOW (usb pwr disabled) on boot and it's the=
 usb driver which enables the usb pwr (pulls HIGH) =3D=3D controls the powe=
r supply. This way the usb pwr stays/is off, if someone decides to not incl=
ude or load the usb driver.
&gt;=20
&gt; Mathias
&gt;=20
&gt; [0] https://github.com/torvalds/linux/blob/master/drivers/regulator/fixed=
.c#L159

I ack your nack.  Absolutely fine reasoning.


Cheers,

Kevin D-B

012C ACB2 28C6 C53E 9775  9123 B3A2 389B 9DE2 334A


]