From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755367AbcCUMiC (ORCPT ); Mon, 21 Mar 2016 08:38:02 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:49884 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753166AbcCUMiA (ORCPT ); Mon, 21 Mar 2016 08:38:00 -0400 Date: Mon, 21 Mar 2016 12:37:52 +0000 From: Mark Brown To: Javier Martinez Canillas Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Liam Girdwood , Bjorn Andersson Message-ID: <20160321123752.GR2566@sirena.org.uk> References: <1458527986-4576-1-git-send-email-javier@osg.samsung.com> <20160321111100.GN2566@sirena.org.uk> <56EFE583.6000807@osg.samsung.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="T464TalWMPmNXQHI" Content-Disposition: inline In-Reply-To: <56EFE583.6000807@osg.samsung.com> X-Cookie: Walk softly and carry a megawatt laser. User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: 2a01:348:6:8808:fab::3 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH] regulator: Lookup unresolved parent supplies before regulators cleanup X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --T464TalWMPmNXQHI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Mar 21, 2016 at 09:13:55AM -0300, Javier Martinez Canillas wrote: > On 03/21/2016 08:11 AM, Mark Brown wrote: > > On Sun, Mar 20, 2016 at 11:39:46PM -0300, Javier Martinez Canillas wrote: > >> This patch makes the unresolved parent supplies to be looked up before the > >> regulators late cleanup, so those with a child marked as always on will be > >> enabled regardless if a driver attempted to get the child regulator or not. > > This doesn't make much sense to me as a fix - it feels like we're doing > > a fragile hack. Surely it's better to do this as we register the > > devices, that way we're also protected against any similar issues with > Sorry, not sure if I understood correctly. You mean to do it when the > drivers register the regulators, so at regulator_register() ? > That's basically what was done before Bjorn's patch but that doesn't > handle the case of out of order registration when having circular > dependencies between regulators. We used to look for the parent at registration time, we didn't look for the children. What you're trying to do here is look for the children; we can do that at registration time. > > this that might occur after late probe if things are built modular? Or > Someone told me once that modules are always a special case :) That doesn't mean we should actively go out of our way to break them. > The reason why I did in late_initcall / regulator_init_complete is that > the problem for me is that unused regulators are disabled on cleanup but > parents whose childrens are marked as always on should be keep enabled. > But these are disabled anyways just because the regulator core didn't know > about that dependency. So doing it before the late cleanup sounded like a > good solution for me. Regulators also get disabled if some consumer disables them, that can happen separately to late_initcall() and often happens during consumer device probe. --T464TalWMPmNXQHI Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJW7+sfAAoJECTWi3JdVIfQy0oH/2+8OE3UpTPgsnqm/18uLS+d y+b1TwlSGnz3/Wli9b4LRuWQg4JZR+1vRDxoaOAb/A2/eyfBkYq9mvvDU83Kg2fZ wLC2nWfCNX02HG2kwswVgfZXQynGmg4Hsp9FbCboq+VvGIsOCrkCCVqNoed3j3lc VBMAwJOxuN8pIVQpSLFpJ7bNMi3L7/euJcFNPLJnKOwH3qHo21FRxHzKT54O0Uz0 FN7EybP2+Sssytece3qvri6SN3MJWtrJCXckfB7PRMBkEQIcy8yPnjJQiwM/Gdp0 3pO7JY1DpNNWtg/1EPhUgeIY+fgxcPaajv3OYyZFcsixsgt16ycERzDTQzn7yJo= =T897 -----END PGP SIGNATURE----- --T464TalWMPmNXQHI--