This is a note to let you know that I've just added the patch titled regulator: core: resolve supply for boot-on/always-on regulators to the 5.12-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: regulator-core-resolve-supply-for-boot-on-always-on-regulators.patch and it can be found in the queue-5.12 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 98e48cd9283dbac0e1445ee780889f10b3d1db6a Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx> Date: Thu, 20 May 2021 01:12:23 +0300 Subject: regulator: core: resolve supply for boot-on/always-on regulators From: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx> commit 98e48cd9283dbac0e1445ee780889f10b3d1db6a upstream. For the boot-on/always-on regulators the set_machine_constrainst() is called before resolving rdev->supply. Thus the code would try to enable rdev before enabling supplying regulator. Enforce resolving supply regulator before enabling rdev. Fixes: aea6cb99703e ("regulator: resolve supply after creating regulator") Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx> Link: https://lore.kernel.org/r/20210519221224.2868496-1-dmitry.baryshkov@xxxxxxxxxx Signed-off-by: Mark Brown <broonie@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/regulator/core.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1422,6 +1422,12 @@ static int set_machine_constraints(struc * and we have control then make sure it is enabled. */ if (rdev->constraints->always_on || rdev->constraints->boot_on) { + /* If we want to enable this regulator, make sure that we know + * the supplying regulator. + */ + if (rdev->supply_name && !rdev->supply) + return -EPROBE_DEFER; + if (rdev->supply) { ret = regulator_enable(rdev->supply); if (ret < 0) { Patches currently in stable-queue which might be from dmitry.baryshkov@xxxxxxxxxx are queue-5.12/asoc-core-fix-null-point-dereference-in-fmt_single_name.patch queue-5.12/regulator-core-resolve-supply-for-boot-on-always-on-regulators.patch