Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753395AbdDKUbh (ORCPT ); Tue, 11 Apr 2017 16:31:37 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:51210 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752580AbdDKUbe (ORCPT ); Tue, 11 Apr 2017 16:31:34 -0400 Date: Tue, 11 Apr 2017 21:31:24 +0100 From: Mark Brown To: Dong Aisheng Cc: linux-kernel@vger.kernel.org, shawnguo@kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, lgirdwood@gmail.com, yibin.gong@nxp.com Message-ID: <20170411203124.y7cwyttqfu4a2aov@sirena.org.uk> References: <1491962327-12477-1-git-send-email-aisheng.dong@nxp.com> <1491962327-12477-2-git-send-email-aisheng.dong@nxp.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="34qdgdw7acxym3vg" Content-Disposition: inline In-Reply-To: <1491962327-12477-2-git-send-email-aisheng.dong@nxp.com> X-Cookie: F u cn rd ths u cnt spl wrth a dm! User-Agent: NeoMutt/20170306 (1.8.0) X-SA-Exim-Connect-IP: 2001:470:1f1d:6b5::3 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH 2/6] regulator: anatop: only set supply regulator when it actually exists X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: No (on mezzanine.sirena.org.uk); Unknown failure Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1707 Lines: 41 --34qdgdw7acxym3vg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 12, 2017 at 09:58:43AM +0800, Dong Aisheng wrote: > Mandatorily set the initdata->supply_regulator while it actually not > exist will cause regulator core to resolve supply each time whenever > a new regulator registered which is meaningless and waste CPU mips. >=20 > We can observe more than one hundred times of iteration of resolving > during a MX6Q SDB board booting up. >=20 > This patch adds the condition check for vin-supply to avoid the issue. This is an obvious abstraction failure - there is nothing magical about your driver which means that we need special casing in it to handle badly written DTs that don't specify supplies. Exactly the same argument applies to all other regulators so if this is worth fixing it's worth fixing in the core so we substitute in a dummy regulator if the supply is genuinely missing. Which is something we in fact have code to do already though for some reason I can't see we bypass it, I'll send a patch just now... --34qdgdw7acxym3vg Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAljtPRsACgkQJNaLcl1U h9BmTggAhVAM2G9i8Hz1D8YRVo2MI8UFRjf5sX/HXld0SmXCGk2Ax/4u0Dt8TbQz i5RY/csBjE7g6zP1W/IXH/NabYlow2Ud9Xah6tDbDG2aPWS2Bu5VAAA/hhgtM2vZ 5BOGKf3WItXMyCraKhw7RhzwMs7pxFcZe6AvenECAj+dT/WJUBxgbxHQ9usHx0d8 9X69lwiJ1TTYwigBMeiN8IZNeDCHuo5oDA91ZdzBYZvds8Jp87JlOifnDw6KwJaW LX91xXG2A++9qTCxpdeFCbAfiUpCiCAq6VVIkslmOWfGDC5GlfEkeiGiFPyteK0P TiEYadpjE4DTm6NB6X48u8pSu1erBw== =5oNb -----END PGP SIGNATURE----- --34qdgdw7acxym3vg--