Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933240AbcDKNpo (ORCPT ); Mon, 11 Apr 2016 09:45:44 -0400 Received: from lists.s-osg.org ([54.187.51.154]:41607 "EHLO lists.s-osg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932603AbcDKNpV (ORCPT ); Mon, 11 Apr 2016 09:45:21 -0400 Subject: Re: [PATCH 1/5] regulator: core: Resolve supply earlier To: Thierry Reding , Mark Brown References: <1460038959-21592-1-git-send-email-thierry.reding@gmail.com> <570B8376.6030505@nvidia.com> <20160411114612.GD17743@ulmo.ba.sec> <20160411125814.GE3351@sirena.org.uk> <20160411130914.GA16994@ulmo.ba.sec> Cc: Jon Hunter , Liam Girdwood , linux-kernel@vger.kernel.org, Bjorn Andersson From: Javier Martinez Canillas Message-ID: <570BAA68.2000701@osg.samsung.com> Date: Mon, 11 Apr 2016 09:45:12 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160411130914.GA16994@ulmo.ba.sec> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2352 Lines: 59 [adding Bjorn Andersson to cc list] Hello, On 04/11/2016 09:09 AM, Thierry Reding wrote: > On Mon, Apr 11, 2016 at 01:58:14PM +0100, Mark Brown wrote: >> On Mon, Apr 11, 2016 at 01:46:12PM +0200, Thierry Reding wrote: >>> On Mon, Apr 11, 2016 at 11:59:02AM +0100, Jon Hunter wrote: >> >>>> Also, if we add this call, then I am wondering if we still need ... >>>> >>>> class_for_each_device(®ulator_class, NULL, NULL, >>>> regulator_register_resolve_supply); >> >>> Possibly not. That line was introduced to hook up existing orphan >>> regulators with their parents when they were registered, but I guess >>> since we now always defer probe if a parent isn't registered yet the >>> line would become a no-op. >> >> That then takes us right the way back to the original problem where >> people we're getting upset at the number of probe deferrals they were >> seeing and more importantly we didn't have any way of sorting out >> dependencies within a single PMIC if the parents weren't registered >> before their children. > > Isn't that usually solved by making each regulator of a PMIC a separate > device (platform device, typically, for MFD devices? That way each of > them is probed separately allowing the dependency cycle to be broken. > IIRC the problem was that in some systems 2 PMICs can have circular dependencies. That is, PMIC A can have as input supply a regulator from PMIC B and PMIC B can have as input supply a regulator from A. So the parent supply resolution was moved from regulator_register to regulator_get in commit 6261b06de565 ("regulator: Defer lookup of supply to regulator_get"). That way, regulators could be registered out of order and the supply looked up only on get. The side effect of that change was that only regulators that are get will resolve their parent supplies and that is why commit 5e3ca2b349b1 ("regulator: Try to resolve regulators supplies on registration") was needed for regulators that don't have a client driver that looks them up (usually the always-on ones). The latter commit tries to resolve the parent supply on registration but it's only enforced on get to allow out or order registration of parent supplies. Now $SUBJECT will break the use case for Bjorn's commit AFAIU. > Thierry > Best regards, -- Javier Martinez Canillas Open Source Group Samsung Research America