]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
regulator: core: move supply check earlier in set_machine_constraints()
authorAndré Draszik <andre.draszik@linaro.org>
Fri, 9 Jan 2026 08:38:39 +0000 (08:38 +0000)
committerMark Brown <broonie@kernel.org>
Fri, 9 Jan 2026 13:37:56 +0000 (13:37 +0000)
commit86a8eeb0e913f4b6a55dabba5122098d4e805e55
treec7c945286c2ab5afc353eb3d6cfc5366768af645
parent497330b203d2c59c5ff3fa4c34d14494d7203bc3
regulator: core: move supply check earlier in set_machine_constraints()

Since commit 98e48cd9283d ("regulator: core: resolve supply for
boot-on/always-on regulators"), set_machine_constraints() can return
-EPROBE_DEFER very late, after it has done a lot of work and
configuration of the regulator.

This means that configuration will happen multiple times for no
benefit in that case. Furthermore, this can lead to timing-dependent
voltage glitches as mentioned e.g. in commit 8a866d527ac0 ("regulator:
core: Resolve supply name earlier to prevent double-init").

We can know that it's going to fail very early, in particular before
going through the complete regulator configuration by moving some code
around a little.

Do so to avoid re-configuring the regulator multiple times, also
avoiding the voltage glitches if we can.

Fixes: 98e48cd9283d ("regulator: core: resolve supply for boot-on/always-on regulators")
Signed-off-by: André Draszik <andre.draszik@linaro.org>
Link: https://patch.msgid.link/20260109-regulators-defer-v2-3-1a25dc968e60@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/core.c