regulator: defer probe when trying to get voltage from unresolved supply
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>
Mon, 2 Nov 2020 21:27:27 +0000 (22:27 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Nov 2020 17:27:52 +0000 (18:27 +0100)
commitf31e8dea41926ca67f7c9ebb180bf6082d9707c5
tree14bb680598da42f4a0e2ad7a0990d74939d830d4
parent27ce4f2a6817e38ca74c643d47a96359f6cc0c1c
regulator: defer probe when trying to get voltage from unresolved supply

[ 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 <mirq-linux@rere.qmqm.pl>
Reported-by: Ondřej Jirman <megous@megous.com>
Reported-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Tested-by: Ondřej Jirman <megous@megous.com>
Link: https://lore.kernel.org/r/a9041d68b4d35e4a2dd71629c8a6422662acb5ee.1604351936.git.mirq-linux@rere.qmqm.pl
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/regulator/core.c