Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3882287pxb; Tue, 17 Nov 2020 06:08:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJw+2pTSdJWUKbhdTgjUMdLwsZ31pyKx+rxIhEoL/ZBVTh8+uqLVQlWSIaZ15/OkqTAgplNL X-Received: by 2002:a17:906:6d99:: with SMTP id h25mr19879052ejt.281.1605622085441; Tue, 17 Nov 2020 06:08:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605622085; cv=none; d=google.com; s=arc-20160816; b=ZQkLRlWTAgnmsQ+XvFudcyoT9pkJXI9pb+0W/ETA+iuH7iPU6qq+Nw1QUc77LR216S S1qH3x7UVZPyqBWdSif9G9BvJZXU/dG1fxgU+N2MNY8gV4cxkSLBbvDrHMW/015ON9Wo pV/tkFnZzvhdVUZlQwHgbHgwnD2Jq+tFid9eLC91bLhnAjD6zW5/PJthZksGWY55gXy0 FkMAX5RbbfiouzJwBc5Ws4nN/AdQ4X8iEN1HScEQe+tEiDYLSpvJyseUspU74k0swFB1 7RAMyAJhMnYlKyhiBnR3kbZDnDv9NDjADtu+zuAoZ0o1roZ2qUv7qcjC1WRhesZxNKYn mseg== 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=lSPJFEG0fdqmiZvR2bKbVkqMZnyAcHM0C1fCy2T4tgw=; b=cQzzl72eyuG5zIdlm09F5QRgmZyKjjB4rNU94YPYr5pK+9BLakCf7rbSHqyJaSAbEy FwRb0XmByKTGW0xg/dnSEGdN1kjicW9peey1LktsylexSSLw0LmVoxhUgl9kc6+Olcvv uF8wXO5FRaZyIAdzaa5tZBUZ8Dzd3v4bre4ICBr7Heo0Ks5rocmIsuclyuA7mzOLJdRv V5Fp8DDsQZCoKLA90A4sokrJvHwtU2oQEH5PimxKwLJqdTHh7rzyLs3jel1KpROzqkM3 SvtUs6lIPOGE2IBbVTTxID6KmFcIaZaX73oQOIQrQu60L9ly81OcywC+KDPjMZ5gpZcB Bqfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uAAUeqG5; 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 lz6si13794634ejb.116.2020.11.17.06.07.41; Tue, 17 Nov 2020 06:08:05 -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=uAAUeqG5; 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 S2387555AbgKQOFC (ORCPT + 99 others); Tue, 17 Nov 2020 09:05:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:38228 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728738AbgKQNJS (ORCPT ); Tue, 17 Nov 2020 08:09:18 -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 DE0152468F; Tue, 17 Nov 2020 13:09:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605618557; bh=uLws+EVf+TYNMDRCPYzmyez1zVXCcR3NUyUaD3WzrmI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uAAUeqG5K+Fw7FAhVF64/qP2w8NBTNU0wRcrRBGaV7Ibafr2JGSMysvKsjw9mN3r+ jyc4erWAJyRnLwmnXHSSTXuWzRbkJ/1kE/AjClWF50BXQsj/MwSuJtqj85jtRce+Sa FDQE2j8OBCLKOnWjQXw1uvNzz0gopa50gOqqN9ek= 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 , Sasha Levin Subject: [PATCH 4.9 01/78] regulator: defer probe when trying to get voltage from unresolved supply Date: Tue, 17 Nov 2020 14:04:27 +0100 Message-Id: <20201117122109.187747121@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122109.116890262@linuxfoundation.org> References: <20201117122109.116890262@linuxfoundation.org> User-Agent: quilt/0.66 X-stable: review X-Patchwork-Hint: ignore 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 [ Upstream commit cf1ad559a20d1930aa7b47a52f54e1f8718de301 ] 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: Sasha Levin --- drivers/regulator/core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 0f730e4bf6bcb..0caf751d85ded 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -3185,6 +3185,8 @@ static int _regulator_get_voltage(struct regulator_dev *rdev) ret = rdev->desc->fixed_uV; } else if (rdev->supply) { ret = _regulator_get_voltage(rdev->supply->rdev); + } else if (rdev->supply_name) { + return -EPROBE_DEFER; } else { return -EINVAL; } -- 2.27.0