Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3879217pxb; Tue, 17 Nov 2020 06:04:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJy1a4cMcZ28ORaYckXB0W5iDS8f6TaNcgRRgUad5Cz0jjkaTau1isVWcpicQnBCpcXDFsjb X-Received: by 2002:a05:6402:12c8:: with SMTP id k8mr1080018edx.192.1605621877482; Tue, 17 Nov 2020 06:04:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605621877; cv=none; d=google.com; s=arc-20160816; b=ln1WZNPG3KODRwljL7v2DJosrwztUa3IQWm0sVgA1/u+Xlh19B7vyFEAP06RlCFUMR xyYwp6LGcWDq0CmU/ArprmAyrgzTWneEMBz5Q384ZoW6/Dkn/RCHhh0E+of+RJO6vrTe 7cx3E/i8S3wIi0bLFN2j6bo7kLNwCUc3AKlhg5RimfIBeOv6okwZjN4UaO0vZenZMuUI C4kx054QsmlSsprraPwPWVe4qlgz0Xy42gPuuU43fIegYfRwnA09eD8346Ks2w34imyE VulOPvqApU3Pw46QZL/Ndlz+OEHGXYOfmXz71kFlIcPulzey0utecknqTqMU1lk9gAeP fo0g== 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=V7RITldK9oZ+whGNjSJR27K/WGOAIgiNtDw5dEuQhzE=; b=VviO90RrK24qUBpXu+aeuZM4i3bU0uMTFr6lT3azHBBGbeCLmPKy5Ejt92aGpAtxPs CZLcAk6eFR1BLAXMY8CfL5nXEElTULK0vYlDtMfWpoc0Iynb0Ajf23hANKEa206EIcKc lHJ+RZhaGiLgTZRCGBDZuatiB4yBCtJVXiQRexCgDUnsDDmh0gks/No6KlQGvKFrsglZ WDejLNRswRsA4qddoTIo2F4jGt/LwMvW895jaV+m0usP7qDu1WHW0FOwO4Xi7LRN40cC GEPNoBxom78GGBIucZQSNHovbhkW5PAsrSQ//O5k0AvD/qMmcVGfUgBT2Lja6n42foBk Xq8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jOxrVjQh; 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 j19si13752422ejs.634.2020.11.17.06.04.06; Tue, 17 Nov 2020 06:04:37 -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=jOxrVjQh; 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 S1731651AbgKQN74 (ORCPT + 99 others); Tue, 17 Nov 2020 08:59:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:49682 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730556AbgKQNRZ (ORCPT ); Tue, 17 Nov 2020 08:17:25 -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 21E5B2225B; Tue, 17 Nov 2020 13:17:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605619043; bh=r9FZfaF4eisPjUR73+5jQ3IF4euogePyoV4bXnwH3RA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jOxrVjQhAInJonKgjGsLSP96RjHJ+bUezv7bMDCK9LwsSkXGDlcGQKc1X7VTuV1M/ 5wMu5jHiVgUWkzObFLSM1dM93H5AA/VOqcUdGODmHxST5Atkzh0DFjCbfgFR6mqxP2 PKptoSv8qu6GYcblirYUEU5Q2TIUVkq2FcbmU4iU= 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.19 001/101] regulator: defer probe when trying to get voltage from unresolved supply Date: Tue, 17 Nov 2020 14:04:28 +0100 Message-Id: <20201117122113.196963972@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122113.128215851@linuxfoundation.org> References: <20201117122113.128215851@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 c290c89421314..ad5235ca8e4ee 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -3405,6 +3405,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