|
Takashi Iwai |
7dfc94 |
From cf1ad559a20d1930aa7b47a52f54e1f8718de301 Mon Sep 17 00:00:00 2001
|
|
Takashi Iwai |
7dfc94 |
From: =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= <mirq-linux@rere.qmqm.pl>
|
|
Takashi Iwai |
7dfc94 |
Date: Mon, 2 Nov 2020 22:27:27 +0100
|
|
Takashi Iwai |
7dfc94 |
Subject: [PATCH] regulator: defer probe when trying to get voltage from unresolved supply
|
|
Takashi Iwai |
7dfc94 |
Mime-version: 1.0
|
|
Takashi Iwai |
7dfc94 |
Content-type: text/plain; charset=UTF-8
|
|
Takashi Iwai |
7dfc94 |
Content-transfer-encoding: 8bit
|
|
Takashi Iwai |
7dfc94 |
Git-commit: cf1ad559a20d1930aa7b47a52f54e1f8718de301
|
|
Takashi Iwai |
7dfc94 |
Patch-mainline: v5.10-rc3
|
|
Takashi Iwai |
7dfc94 |
References: git-fixes
|
|
Takashi Iwai |
7dfc94 |
|
|
Takashi Iwai |
7dfc94 |
regulator_get_voltage_rdev() is called in regulator probe() when
|
|
Takashi Iwai |
7dfc94 |
applying machine constraints. The "fixed" commit exposed the problem
|
|
Takashi Iwai |
7dfc94 |
that non-bypassed regulators can forward the request to its parent
|
|
Takashi Iwai |
7dfc94 |
(like bypassed ones) supply. Return -EPROBE_DEFER when the supply
|
|
Takashi Iwai |
7dfc94 |
is expected but not resolved yet.
|
|
Takashi Iwai |
7dfc94 |
|
|
Takashi Iwai |
7dfc94 |
Fixes: aea6cb99703e ("regulator: resolve supply after creating regulator")
|
|
Takashi Iwai |
7dfc94 |
Cc: stable@vger.kernel.org
|
|
Takashi Iwai |
7dfc94 |
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
|
|
Takashi Iwai |
7dfc94 |
Reported-by: Ondřej Jirman <megous@megous.com>
|
|
Takashi Iwai |
7dfc94 |
Reported-by: Corentin Labbe <clabbe.montjoie@gmail.com>
|
|
Takashi Iwai |
7dfc94 |
Tested-by: Ondřej Jirman <megous@megous.com>
|
|
Takashi Iwai |
7dfc94 |
Link: https://lore.kernel.org/r/a9041d68b4d35e4a2dd71629c8a6422662acb5ee.1604351936.git.mirq-linux@rere.qmqm.pl
|
|
Takashi Iwai |
7dfc94 |
Signed-off-by: Mark Brown <broonie@kernel.org>
|
|
Takashi Iwai |
7dfc94 |
Acked-by: Takashi Iwai <tiwai@suse.de>
|
|
Takashi Iwai |
7dfc94 |
|
|
Takashi Iwai |
7dfc94 |
---
|
|
Takashi Iwai |
7dfc94 |
drivers/regulator/core.c | 2 ++
|
|
Takashi Iwai |
7dfc94 |
1 file changed, 2 insertions(+)
|
|
Takashi Iwai |
7dfc94 |
|
|
Takashi Iwai |
7dfc94 |
--- a/drivers/regulator/core.c
|
|
Takashi Iwai |
7dfc94 |
+++ b/drivers/regulator/core.c
|
|
Takashi Iwai |
7dfc94 |
@@ -3202,6 +3202,8 @@ static int _regulator_get_voltage(struct
|
|
Takashi Iwai |
7dfc94 |
ret = rdev->desc->fixed_uV;
|
|
Takashi Iwai |
7dfc94 |
} else if (rdev->supply) {
|
|
Takashi Iwai |
7dfc94 |
ret = _regulator_get_voltage(rdev->supply->rdev);
|
|
Takashi Iwai |
7dfc94 |
+ } else if (rdev->supply_name) {
|
|
Takashi Iwai |
7dfc94 |
+ return -EPROBE_DEFER;
|
|
Takashi Iwai |
7dfc94 |
} else {
|
|
Takashi Iwai |
7dfc94 |
return -EINVAL;
|
|
Takashi Iwai |
7dfc94 |
}
|