Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp151599pxb; Mon, 2 Nov 2020 17:02:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJyIquzTG77F5nTxb+dsmSXauWdMFUM/0xKdXrBnKjwUA2J5hH8SaqytCa4t0Xkq4Y/1DcSA X-Received: by 2002:aa7:cd56:: with SMTP id v22mr19874158edw.245.1604365346419; Mon, 02 Nov 2020 17:02:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604365346; cv=none; d=google.com; s=arc-20160816; b=Re3hpZe2FiOvPQW5FDZZErDG1wCpUu7XFzF9G136oTCKbAg9xQsropqQXz1ifUBuaO MEA5l5TBxf1KenzT2hazLXtfjMtE9ljfsA+F+UaSaW0cv/SGUVknWT712MKyhsyoRtlH 6JufdjzoyYi8chw+TI2sYwLP3JuHaadGeinnszjDsatZRfV/LUTQd2eCYdNBYONlZ/SD hRt2HUK2OWVpSwf9Ot+6Afat04f7IK3GJdehuUXZxyJ9FB0Ixa5ThPyDQum7ObNBcF+x 2Upm5Z6lbzR1GqkcZXGHJn7wIptdCsE/w7b+b3AbWlObCG84UtVqFrhqdZO0If4AQnNa 8cOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=i17lIDJvtxShS6re8Zl5tEffNSTVLToP/FRPooO2kDs=; b=Ees0CHGU4PliD4qhmHA3QUqdo8TJ7wuQRfHW0WWDPpvBTFWgww4SVZXRZvNAlBIuPX 18bXR+mOzFk9CGHcZE+83MHIdayC5VIi/q5itTaMbeIK+92HA4RHRkXfVb6KA0E1BF6f kyqv4MS22tBBXSuinqgWpoR8YXTGU6LBveARs52WbtS2mQjXy9rYEiWQr3MZ7vsAkGBd W2YxCXBLnVVQZCdwUX79Esq1fbUVFBaSWw60FWrAZOzgH+RjTdhF/0CzWVLezmb09Ol2 DukvgdiCQmfWeXl+XHCMxN5rCVaROBX5Q5Z1yeBrgVV2dVIc6oW1sxQoSoZ9EGDOYQ7i e9yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@megous.com header.s=mail header.b=l7HTx+tF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=megous.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cb21si3371721edb.267.2020.11.02.17.02.03; Mon, 02 Nov 2020 17:02:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@megous.com header.s=mail header.b=l7HTx+tF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=megous.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725958AbgKCA7m (ORCPT + 99 others); Mon, 2 Nov 2020 19:59:42 -0500 Received: from vps.xff.cz ([195.181.215.36]:42022 "EHLO vps.xff.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725855AbgKCA7m (ORCPT ); Mon, 2 Nov 2020 19:59:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megous.com; s=mail; t=1604365180; bh=089NW4EV+AXNBn4l7uQ4zi2lQU+TDwonIKQk0SRKAwo=; h=Date:From:To:Cc:Subject:References:X-My-GPG-KeyId:From; b=l7HTx+tFDkVGYaCEwtciREO4kDO2rHCpmGKPlaYwA36LoNIR1q4fRJaucFoOzUSBb nNXxfjyoXaFvImOW0E8zUBYguDjxJWr2JJ31dKzE5jwTt8pb8UeaVEveydNnCs5Ne4 2y9aa66IBOesQDKnE/Gj90oWYN/xt2MfVAe+ZlTE= Date: Tue, 3 Nov 2020 01:59:39 +0100 From: =?utf-8?Q?Ond=C5=99ej?= Jirman To: =?utf-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= Cc: Liam Girdwood , Mark Brown , Corentin Labbe , Ahmad Fatoum , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com Subject: Re: [PATCH v1] regulator: defer probe when trying to get voltage from unresolved supply Message-ID: <20201103005939.v563wbvbzks6ecjm@core.my.home> Mail-Followup-To: =?utf-8?Q?Ond=C5=99ej?= Jirman , =?utf-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , Liam Girdwood , Mark Brown , Corentin Labbe , Ahmad Fatoum , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-My-GPG-KeyId: EBFBDDE11FB918D44D1F56C1F9F0A873BE9777ED Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Michal, On Mon, Nov 02, 2020 at 10:27:27PM +0100, Michał Mirosław wrote: > regulator_get_voltage_rdev() is called in regulator probe() when > applying machine constraints. The "fixed" commit exposed the problem > that non-bypassed regulators can forward the request to its parent > (like bypassed ones) supply. Return -EPROBE_DEFER when the supply > is expected but not resolved yet. > Tested-by: Ondřej Jirman thank you very much, Ondrej > Fixes: aea6cb99703e ("regulator: resolve supply after creating regulator") > Cc: stable@vger.kernel.org > Signed-off-by: Michał Mirosław > Reported-by: Ondřej Jirman > Reported-by: Corentin Labbe > --- > v1: this is a bit different solution than the hack sent earlier. It should > be equivalent (putting the error code at the source), but please > test again. > --- > drivers/regulator/core.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c > index a4ffd71696da..a5ad553da8cd 100644 > --- a/drivers/regulator/core.c > +++ b/drivers/regulator/core.c > @@ -4165,6 +4165,8 @@ int regulator_get_voltage_rdev(struct regulator_dev *rdev) > ret = rdev->desc->fixed_uV; > } else if (rdev->supply) { > ret = regulator_get_voltage_rdev(rdev->supply->rdev); > + } else if (rdev->supply_name) { > + return -EPROBE_DEFER; > } else { > return -EINVAL; > } > -- > 2.20.1 >