Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3199246pxb; Mon, 9 Nov 2020 05:25:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJxuq5SDoRLoYAgTfc1wWQ1dP/MfaY2xhXg1RWn3V9Jfl0nLBO+yiFByX9A1wlOppLNU2JqY X-Received: by 2002:a17:906:a106:: with SMTP id t6mr13401216ejy.63.1604928327942; Mon, 09 Nov 2020 05:25:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604928327; cv=none; d=google.com; s=arc-20160816; b=Nr3fmPVhmshYeERyICShcxi8jt4icC/TK7XYAAeuwB52QSFts6Dp7D6Kf4qBTFycUq +U5kJgl8oqq9iSBssABmFzVuUD9H3rrbhCtinbHbIxgtVeG4ZLIWAKe1EZpgXvymLf26 F8eH/bqLp7Up0lMwqZecdW2iwDkeDLUPbPoH+xv64Muk+ME1+prizA0asuDAPnYJbcVn 8wRejcY+NyvP7S4FDN7TYQzBmtNMuSblfV/fJqhPf9AMhQeMcnj4u+j8vXFBWtR08Hqa ESKJDLoSEuNaI8Jf2qeYr7ZrmW/3118OrfkuKaOhbTAqM9/2GvufOovZB5HhWApf16Vp bDRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZyU8HdrbJGXSYUTkOdvNZvQz5g+SEecQNgQTFuYouUA=; b=GyeV++nBCe23rnGpC4vgl64y9pJPhU6lGsX1NtWLC574CWV6mXp/v/fzRZpA8SbfBX 21fqBnj8NHW36ztt7/xeJG2q+rbAHtrshHwh4U+g8rnOA8PO0MfROm4SLdG3p/5jdAhi AYl5BzEB3SgG0cy5UYtvqxaQ5YV5VEJoHwPSvD2RrnEMenTpdl4rQs87SHgcuhlGZydk rOBk0/66QQBN2fAb6tuAyk93bZ0JAEMYbWku37O5Vyms3bxsn3ge3Bti48ZcsuSmL6nd V0CPj186SBXo3W7Q0f8Gc7yJaUfHoiqrZB96rxmp1lbrhtkDZBiEQDes8rA2DHfetWUJ uYXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OWbV2Vae; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n2si8321560edi.564.2020.11.09.05.25.04; Mon, 09 Nov 2020 05:25:27 -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=@kernel.org header.s=default header.b=OWbV2Vae; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733173AbgKINXr (ORCPT + 99 others); Mon, 9 Nov 2020 08:23:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:47764 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387913AbgKINUO (ORCPT ); Mon, 9 Nov 2020 08:20:14 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6E65020731; Mon, 9 Nov 2020 13:20:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604928013; bh=SomfTy7xvoRYWIRiKoLH7kzUnccZPZAoGzIEM11TDvg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OWbV2VaeWLAayczO/VGb4eDvVhZN9dgbzngCEHhihm75akGdDt6EFbnG7/arTutc4 WE1ufxRAnzVJVA5lDVJv5ndyG9ZZB8cmnk5bNecjJxvd9fjpD5GCpGmXxDhMMzfZjx /rW6h3EJAkr6Zw4Cne0CHChEbNfG+F7EV251C+RY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= , =?UTF-8?q?Ond=C5=99ej=20Jirman?= , Corentin Labbe , Mark Brown Subject: [PATCH 5.9 067/133] regulator: defer probe when trying to get voltage from unresolved supply Date: Mon, 9 Nov 2020 13:55:29 +0100 Message-Id: <20201109125033.957823889@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109125030.706496283@linuxfoundation.org> References: <20201109125030.706496283@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michał Mirosław commit cf1ad559a20d1930aa7b47a52f54e1f8718de301 upstream. 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. 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 Tested-by: Ondřej Jirman Link: https://lore.kernel.org/r/a9041d68b4d35e4a2dd71629c8a6422662acb5ee.1604351936.git.mirq-linux@rere.qmqm.pl Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- drivers/regulator/core.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -4128,6 +4128,8 @@ int regulator_get_voltage_rdev(struct re 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; }