Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753878AbcDVL1I (ORCPT ); Fri, 22 Apr 2016 07:27:08 -0400 Received: from hqemgate14.nvidia.com ([216.228.121.143]:9768 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752064AbcDVL1E (ORCPT ); Fri, 22 Apr 2016 07:27:04 -0400 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Fri, 22 Apr 2016 04:26:52 -0700 Subject: Re: [PATCH 4/5] regulator: core: Add early supply resolution for a bypassed regulator To: Mark Brown References: <1461255121-5245-1-git-send-email-jonathanh@nvidia.com> <1461255121-5245-5-git-send-email-jonathanh@nvidia.com> <20160422104837.GC3217@sirena.org.uk> CC: Liam Girdwood , , , Thierry Reding From: Jon Hunter Message-ID: <571A0A81.4010009@nvidia.com> Date: Fri, 22 Apr 2016 12:26:57 +0100 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: <20160422104837.GC3217@sirena.org.uk> X-Originating-IP: [10.21.132.108] X-ClientProxiedBy: UKMAIL101.nvidia.com (10.26.138.13) To UKMAIL101.nvidia.com (10.26.138.13) 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: 1580 Lines: 33 On 22/04/16 11:48, Mark Brown wrote: > * PGP Signed by an unknown key > > On Thu, Apr 21, 2016 at 05:12:00PM +0100, Jon Hunter wrote: > >> A regulator that is in bypass will fail to be registered because we will >> attempt to get the voltage of the regulator (ie. it's bypass voltage) >> before the supply for the regulator has been resolved. Therefore, when >> getting the voltage for a bypassed regulator, if the supply has not been >> resolved, then attempt to resolve it. Additionally, move the setup of >> the regulator's supply name to before the call to >> set_machine_constraints() so that it can be resolved. > > The basic pattern here makes sense but rather than doing this > specifically in the case where we have a bypassed supply we didn't > resolve yet I think we should instead always try to resolve the supply > but ignore the error unless we actively need the supply. I'd be > surprised if we didn't run into other cases where we need to do this so > it seems better to try the resolution in one place. OK. Sorry if I have misunderstood you here, but this sounds more like Thierry's initial proposal [0] but ignoring the any errors returned (and we need to fix-up the locking in this patch). In the discussion that followed I thought we agreed to only do this for the bypass case [1]. As far as I am concerned either will work, but to confirm we should just always try to resolve the supply early during regulator_register(), correct? Cheers Jon [0] http://marc.info/?t=146003907800001&r=1&w=2 [1] http://marc.info/?l=linux-kernel&m=146038421710211&w=2