Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3193777pxb; Mon, 9 Nov 2020 05:17:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJxdK4Zle+ODyj94nIMGgbS5FEQ3ROpIATMmmcMINpgX417p8jmuj4V3eEqPNVzNJum211Yq X-Received: by 2002:a17:907:b01:: with SMTP id h1mr14566243ejl.10.1604927871334; Mon, 09 Nov 2020 05:17:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604927871; cv=none; d=google.com; s=arc-20160816; b=gWtt2X77SeyxJisf3Tm5+0I8LrzbIg7qrOLnUi4b1JmYehLbyAmye0GaYuYzJ/hPA/ F9OR/FwNVeLBS7YVTIOBu+u1F+TUSbuutXXyZBps5dvaeRXxvbVeX8A9yqmHYEn/JPuE YXLnNpC6n4Vi6xN1tq7m/WgCSdX+heulDoMnJ5wbIbGtXVYAU27tCXbM7hiU1ZqvElkz rIZp9ZlMY5qNYJbBymGJ6OCADt1TkTp+NoTt8TUcIMM3ZRJIZZJtuIbqgGjcZXXjWZv4 oaoiNYcWx5vi98BzCfU0TzODJIVFIHGxEFBoOWngmp8NAOrprHijEYlbYACnBVhOMqCC Pgdg== 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=zf8bGgMUm2ADqDouHw5Zkvz9WSljT9YfwQskdPfSWbQ=; b=w49zl0zBSnvzZK8mtNP9cyyodbq4Hf8ofvfmpi7kRUxjpXeDyaPj1ZSKjL4DsAWOVr aoRJl+bDxIJ0MRK7eAwVal1H+m0A3rJZ5AgR6Tfsk2hkQn60XXrNAuo7echC1BdciMXv 4fUYGW0lUpKDzlY/KEUzZxJtqqXzbSw2yFJqSqJpkRvWatD0SQ9WySLRvFaSG9OXgUj4 Lv10QjVbLqWtPhtTaKxHGscnReXgaishFuilD5l3VrvTFgg0iHoDpoBQ7dlhoSLaxQyi qMG8XMud1F9Ha9KM1CmIddn18RGaAqnPhSfaO84W4YqrOzyyPqdS9vvoWGbDCv2Yt4On j6Hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="L/63sCo2"; 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 d12si6408328edj.601.2020.11.09.05.17.27; Mon, 09 Nov 2020 05:17:51 -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="L/63sCo2"; 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 S1733274AbgKINPG (ORCPT + 99 others); Mon, 9 Nov 2020 08:15:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:38866 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731938AbgKINNE (ORCPT ); Mon, 9 Nov 2020 08:13:04 -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 BED742076E; Mon, 9 Nov 2020 13:13:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604927583; bh=mxkDyEhr2are9D1bZsdv0ppHMBALf/5gP8sCK3e55XY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L/63sCo2a/U3crbDxi6wmLfjLQcoHSRDMvPVyIbiZ1sqY4JLtLOePT8pPthTnnCDl 5/YQ9KNXr7HujKB3nfJJjQriKVoaOrDUAomQpwFm/k2Hio3co7a8cnIL35bdL0L9/k E/Q4AnYOrOUrOG+Xh/YKJP+pZuToejgm0JLpFsPg= 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.4 38/85] regulator: defer probe when trying to get voltage from unresolved supply Date: Mon, 9 Nov 2020 13:55:35 +0100 Message-Id: <20201109125024.423914934@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109125022.614792961@linuxfoundation.org> References: <20201109125022.614792961@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 @@ -4045,6 +4045,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; }