[PATCH v2 0/8] regulator: core: allow regulator_register() with missing required supply

André Draszik posted 8 patches 4 weeks, 1 day ago
drivers/regulator/core.c         | 351 ++++++++++++++++++++++++++++-----------
include/linux/regulator/driver.h |   2 +
2 files changed, 254 insertions(+), 99 deletions(-)
[PATCH v2 0/8] regulator: core: allow regulator_register() with missing required supply
Posted by André Draszik 4 weeks, 1 day ago
Hi,

With these attached patches it becomes possible again to support
hardware designs with multiple PMICs where individual rails of each act
as required supplies for rails of the other (due to the latter being
e.g. always-on), and vice-versa.

Google Pixel 6 and 6 Pro (oriole and raven) are examples of such
designs.

Rather than returning -EPORBE_DEFER in regulator_register() when
set_machine_constraints() fails with -EPROBE_DEFER (due to missing
required supplies), we still allow rail registration and try to
reresolve supplies each time a new rail gets registered.

This is implemented using a bus (regulator bus), which allows the core
to reresolve supplies for regulators that still need them whenever new
regulators (i.e. devices) are added.

Using a bus also solves existing problems around late resolution of
supplies as mentioned in the commit message introducing that bus.

The series starts with a few bug fixes and the last two commits
implement the changes mentioned above, but do depend on the bug fixes.

Cheers,
Andre'

Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
Changes in v2:
- drop fixes tag from patch 5
- Link to v1: https://lore.kernel.org/r/20251227-regulators-defer-v1-0-3104b22d84cb@linaro.org

---
André Draszik (8):
      regulator: core: update two debug messages
      regulator: core: fix locking in regulator_resolve_supply() error path
      regulator: core: move supply check earlier in set_machine_constraints()
      regulator: core: streamline supply resolution for always-on/boot-on regulators
      regulator: core: remove dead code in regulator_resolve_supply()
      regulator: core: don't ignore errors from event forwarding setup
      regulator: core: reresolve unresolved supplies when available
      regulator: core: don't fail regulator_register() with missing required supply

 drivers/regulator/core.c         | 351 ++++++++++++++++++++++++++++-----------
 include/linux/regulator/driver.h |   2 +
 2 files changed, 254 insertions(+), 99 deletions(-)
---
base-commit: f8f97927abf7c12382dddc93a144fc9df7919b77
change-id: 20251224-regulators-defer-f5ffa668a3f6

Best regards,
-- 
André Draszik <andre.draszik@linaro.org>

Re: [PATCH v2 0/8] regulator: core: allow regulator_register() with missing required supply
Posted by Mark Brown 3 weeks, 4 days ago
On Fri, 09 Jan 2026 08:38:36 +0000, André Draszik wrote:
> With these attached patches it becomes possible again to support
> hardware designs with multiple PMICs where individual rails of each act
> as required supplies for rails of the other (due to the latter being
> e.g. always-on), and vice-versa.
> 
> Google Pixel 6 and 6 Pro (oriole and raven) are examples of such
> designs.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next

Thanks!

[1/8] regulator: core: update two debug messages
      commit: 96e7a88d32de2554a5d7e54e87eb03d445dd6924
[2/8] regulator: core: fix locking in regulator_resolve_supply() error path
      commit: 497330b203d2c59c5ff3fa4c34d14494d7203bc3
[3/8] regulator: core: move supply check earlier in set_machine_constraints()
      commit: 86a8eeb0e913f4b6a55dabba5122098d4e805e55
[4/8] regulator: core: streamline supply resolution for always-on/boot-on regulators
      commit: 4f3323b752bfcc185c98ce4fb841cca8b700a7c0
[5/8] regulator: core: remove dead code in regulator_resolve_supply()
      commit: bdbdc4b398254597c9b6ac279f336750996bc0a6
[6/8] regulator: core: don't ignore errors from event forwarding setup
      commit: e23c0a59dabae9166bbea26fc05d08e7d9e900b7
[7/8] regulator: core: reresolve unresolved supplies when available
      commit: 304f5784e97281f18ef4bed574cbe5fcf6ce2f2e
[8/8] regulator: core: don't fail regulator_register() with missing required supply
      commit: 8d38423d9dea7353a8a54a3ab2e0d0aa04ed34d0

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark