From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754884AbcIIMzd (ORCPT ); Fri, 9 Sep 2016 08:55:33 -0400 Received: from mga05.intel.com ([192.55.52.43]:55061 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754602AbcIIMza (ORCPT ); Fri, 9 Sep 2016 08:55:30 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,305,1470726000"; d="scan'208";a="1053609983" Message-ID: <1473425727.11323.144.camel@linux.intel.com> Subject: Re: Regulator probe From: Andy Shevchenko To: Mark Brown Cc: "linux-kernel@vger.kernel.org" , "Hunter, Adrian" Date: Fri, 09 Sep 2016 15:55:27 +0300 In-Reply-To: <20160909121749.GR27946@sirena.org.uk> References: <1472741623.4887.482.camel@linux.intel.com> <20160901153836.GI5967@sirena.org.uk> <1472746516.4887.489.camel@linux.intel.com> <20160901170215.GJ5967@sirena.org.uk> <1473091312.11323.20.camel@linux.intel.com> <20160906102407.GF3950@sirena.org.uk> <1473258241.11323.83.camel@linux.intel.com> <20160909121749.GR27946@sirena.org.uk> Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5-1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2016-09-09 at 13:17 +0100, Mark Brown wrote: > On Wed, Sep 07, 2016 at 05:24:01PM +0300, Andy Shevchenko wrote: > > > > On Tue, 2016-09-06 at 11:24 +0100, Mark Brown wrote: > > > > > > > > > Nothing says you have to describe all regulators, you just need to > > > tell the core you have told it about everything you're going to > > > tell > > > it about.  Until you do that the core has to assume that something > > > may > > > come along later and describe that supply. > > > > > That's I would like to make work. For now we have fixed voltage > > regulator which returns EPROBE_DEFER since GPIO IP is not > > initialized > > yet at that point. But regulator framework decides that it's not > > possible case and overrides the error code. > > What do you mean?  Of course we should handle probe deferral if we > fail to get a resource like a GPIO.  Are you trying to say that this > doesn't work for you? No, it doesn't. Fixed regulator probe is deferred: reg-fixed-voltage reg-fixed-voltage.0.auto: Failed to register regulator: -517 But: sdhci-pci 0000:00:01.3: No vmmc regulator found Code in sdhci driver is:         ret = mmc_regulator_get_supply(mmc);         if (ret == -EPROBE_DEFER)                 return ret; mmc_regulator_get_supply(): ...         mmc->supply.vmmc = devm_regulator_get_optional(dev, "vmmc");         mmc->supply.vqmmc = devm_regulator_get_optional(dev, "vqmmc");         if (IS_ERR(mmc->supply.vmmc)) {                 if (PTR_ERR(mmc->supply.vmmc) == -EPROBE_DEFER)                         return -EPROBE_DEFER;                 dev_dbg(dev, "No vmmc regulator found\n"); ... So _regulator_get() returns something else than -EPROBE_DEFER. -- Andy Shevchenko Intel Finland Oy