From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933392AbbI3SsS (ORCPT ); Wed, 30 Sep 2015 14:48:18 -0400 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:60685 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932875AbbI3SsQ (ORCPT ); Wed, 30 Sep 2015 14:48:16 -0400 Date: Wed, 30 Sep 2015 20:48:12 +0200 From: Sascha Hauer To: Mark Brown Cc: linux-kernel@vger.kernel.org, Liam Girdwood , kernel@pengutronix.de, alkml@pengutronix.de Subject: Re: [PATCH 1/6] Revert "regulator: core: Handle full constraints systems when resolving supplies" Message-ID: <20150930184812.GE7858@pengutronix.de> References: <1443621474-2191-1-git-send-email-s.hauer@pengutronix.de> <1443621474-2191-2-git-send-email-s.hauer@pengutronix.de> <20150930180213.GL15635@sirena.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150930180213.GL15635@sirena.org.uk> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 20:30:00 up 11 days, 7:59, 64 users, load average: 0.04, 0.14, 0.13 User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 30, 2015 at 07:02:13PM +0100, Mark Brown wrote: > On Wed, Sep 30, 2015 at 03:57:49PM +0200, Sascha Hauer wrote: > > This reverts commit 9f7e25edb1575a6d2363dc003f9cc09d840657e2. > > > > When a regulator A is registered and is supplied by regulator B which is > > not yet registered then a regulator_get on regulator A will set the As > > supply to the dummy regulator. This is not correct, we should return > > -EPROBE_DEFER instead as done without this patch. > > What makes you say this is not correct? In a system with fully > specified supplies if we fail to resolve the supply we know that no > supply will ever appear and so substitute in the dummy on the assumption > that there is a supply with no software control. The situation I'm in is: gpc: gpc@020dc000 { compatible = "fsl,imx6q-gpc"; pu-supply = <®_pu>; }; reg_pu: regulator-vddpu@140 { compatible = "fsl,anatop-regulator"; vin-supply = <&vddsoc_reg>; }; ... pmic@58 { compatible = "dlg,da9063"; regulators { ... vddsoc_reg: bcore2 { regulator-min-microvolt = <730000>; regulator-max-microvolt = <1380000>; regulator-always-on; }; }; }; During boot the fsl,imx6q-gpc is probed and tries to get its regulator. fsl,anatop-regulator is already registered, the dlg,da9063 is not. The call to regulator_get tries to resolve the supply using regulator_resolve_supply. regulator_resolve_supply then calls regulator_dev_lookup which returns NULL because the supply (vddsoc_reg) is specified in the device tree but not yet present. &ret is correctly filled with -EPROBE_DEFER in this case, but this is ignored. Instead due to 9f7e25edb157 the dummy regulator is used. This case worked before 9f7e25edb157. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |