Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752875AbdLUMCj (ORCPT ); Thu, 21 Dec 2017 07:02:39 -0500 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:60702 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751705AbdLUMCh (ORCPT ); Thu, 21 Dec 2017 07:02:37 -0500 Date: Thu, 21 Dec 2017 12:02:31 +0000 From: Mark Brown To: Maciej Purski Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Liam Girdwood , Rob Herring , Mark Rutland , Marek Szyprowski , Bartlomiej Zolnierkiewicz Subject: Re: [PATCH v3 3/4] regulator: core: Parse coupled regulators properties Message-ID: <20171221120231.GI1827@finisterre> References: <1512639975-22241-1-git-send-email-m.purski@samsung.com> <1512639975-22241-4-git-send-email-m.purski@samsung.com> <20171212113511.GF16323@sirena.org.uk> <4866dd1c-e9bb-24e4-9b4a-294d01edde78@samsung.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="CD/aTaZybdUisKIc" Content-Disposition: inline In-Reply-To: <4866dd1c-e9bb-24e4-9b4a-294d01edde78@samsung.com> X-Cookie: Semper Fi, dude. User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2166 Lines: 54 --CD/aTaZybdUisKIc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Dec 21, 2017 at 11:08:19AM +0100, Maciej Purski wrote: > On 12/12/2017 12:35 PM, Mark Brown wrote: > > On Thu, Dec 07, 2017 at 10:46:14AM +0100, Maciej Purski wrote: > > > + mutex_lock(®ulator_list_mutex); > > > + regulator_resolve_coupling(rdev); > > > + mutex_unlock(®ulator_list_mutex); > > I'd really expect us to be failing to probe if we run into an error. > > Otherwise we could end up doing bad things to the hardware at runtime > > later on, or confusing ourselves and crashing with partially set up > > datastructures. > We cannot fail to probe if some of the regulators are not registered > successfully, as depending on the probing sequence, there will be some > regulators, which won't be available when registering others. We can fail > when resolving coupling if we encounter other errors such as max_spread not > provided or disability to set voltage. Maybe that is what you meant. Yes, exactly - not having all the regulators yet isn't the only possible error and this will just ignore all errors. > > It's also not 100% clear to me how we handle the case > > where only some of the coupled regulators have probed. > I have two ideas how to handle it. We can prohibit setting the voltage and > always fail on attempt to set voltage of a coupled regulator. Or we can just > ignore it and set voltage of the regulator without checking the unregistered > ones. At least one of those needs to be implemented (not setting the voltage seems safer). --CD/aTaZybdUisKIc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlo7otYACgkQJNaLcl1U h9DRsQf+Ilp5/CgXPq3rR8YI3H+szPWro/BLa9MF1WwHStA6ChAaMIA7kHNUyLgj ml/P4HxM0lR7BWVi9H22+PXB1J8vRlzchsiAgWsgfXqOSDCkyfoRng/GJwhaXPMP 0WADMTLyHGUb7eeyDn0bLDrTiZeCkV67xs+Eil758j/x6PZhz30kMTmeTR1JxMyj jPFgcyptPTg34pJh5lCU1rOKA5kSvyp7YN70gPWYxuA+KNHFj76vMJNIbTaB/Cqp Ln/VfpyWAEtYIennG+wwIvTtqiDf81yCh7rfjasy7DNbs6U15NEAXvqEGQJWMnPz HTfuye0oOoWtdHcQowTGLThLItyagQ== =6qQu -----END PGP SIGNATURE----- --CD/aTaZybdUisKIc--