commit 4f86a724e82c0 ("power: regulator: denied disable on always-on regulator") throws an error when requested to disable an always-on regulator. It is right that an always-on regulator should not be attempted to be disabled. But at the same time regulator framework should not return an error when such request is received. Instead it should just return success without attempting to disable the specified regulator. This is because the requesting driver will not have the idea if the regulator is always-on or not. The requesting driver will always try to enable/disable regulator as per the required flow. So it is upto regulator framework to not break such scenarios.
Fixes: 4f86a724e82c0 ("power: regulator: denied disable on always-on regulator") Reported-by: Jean-Jacques Hiblot <jjhib...@ti.com> Signed-off-by: Lokesh Vutla <lokeshvu...@ti.com> --- - Without this mmc driver is broken on TI's DRA7 platfroms. - kernel as well follows the same logic while disabling an always-on regulator[1] Logs: Without $patch: https://pastebin.ubuntu.com/p/cNyKTxgKCY/ with $patch: https://pastebin.ubuntu.com/p/PZbgfMp77k/ [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/regulator/core.c#n2333 drivers/power/regulator/regulator-uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/power/regulator/regulator-uclass.c b/drivers/power/regulator/regulator-uclass.c index 4511625ff2..39e46279d5 100644 --- a/drivers/power/regulator/regulator-uclass.c +++ b/drivers/power/regulator/regulator-uclass.c @@ -113,7 +113,7 @@ int regulator_set_enable(struct udevice *dev, bool enable) uc_pdata = dev_get_uclass_platdata(dev); if (!enable && uc_pdata->always_on) - return -EACCES; + return 0; return ops->set_enable(dev, enable); } -- 2.19.2 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot