summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlper Nebi Yasak <alpernebiyasak@gmail.com>2023-10-13 23:27:35 +0300
committerAlper Nebi Yasak <alpernebiyasak@gmail.com>2023-10-14 16:48:41 +0300
commit5b4ced3329f5fd8cb1fa166c8ac424e0bb618d67 (patch)
treee8fc06243ce2439135e2dae2eefb0d1e2ed89498
parentf459e05ecd40592d80d119d16449d40f0dfbfa78 (diff)
u-boot: Add patch to avoid regulator errors
U-Boot upstream has added a reference counting for regulator enable actions which somehow makes gru-kevin unbootable. Add a workaround that makes it work again. Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
-rw-r--r--config/u-boot/default/patches/0004-HACK-regulator-Don-t-error-on-reentrant-regulator-ac.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/config/u-boot/default/patches/0004-HACK-regulator-Don-t-error-on-reentrant-regulator-ac.patch b/config/u-boot/default/patches/0004-HACK-regulator-Don-t-error-on-reentrant-regulator-ac.patch
new file mode 100644
index 00000000..3a66b99a
--- /dev/null
+++ b/config/u-boot/default/patches/0004-HACK-regulator-Don-t-error-on-reentrant-regulator-ac.patch
@@ -0,0 +1,42 @@
+From 2ab104621dc97a89bc8f75e3b5903b83e793baf8 Mon Sep 17 00:00:00 2001
+From: Alper Nebi Yasak <alpernebiyasak@gmail.com>
+Date: Sat, 19 Aug 2023 16:43:58 +0300
+Subject: [PATCH] HACK: regulator: Don't error on reentrant regulator actions
+
+Commit 4fcba5d556b42 ("regulator: implement basic reference counter")
+implements reference counting for regulator enable/disable actions, but
+does not update its callers to handle the error cases it adds. This
+breaks gru-kevin, report enabling the regulator as a success as a
+workaround. It would be better to fix the callers but that needs more
+debugging.
+
+Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
+---
+ drivers/power/regulator/regulator_common.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/power/regulator/regulator_common.c b/drivers/power/regulator/regulator_common.c
+index e26f5ebec347..1c2dfdf9b19d 100644
+--- a/drivers/power/regulator/regulator_common.c
++++ b/drivers/power/regulator/regulator_common.c
+@@ -75,7 +75,7 @@ int regulator_common_set_enable(const struct udevice *dev,
+ /* If previously enabled, increase count */
+ if (enable && plat->enable_count > 0) {
+ plat->enable_count++;
+- return -EALREADY;
++ return 0;
+ }
+
+ if (!enable) {
+@@ -85,7 +85,7 @@ int regulator_common_set_enable(const struct udevice *dev,
+ return -EBUSY;
+ } else if (!plat->enable_count) {
+ /* If already disabled, do nothing */
+- return -EALREADY;
++ return 0;
+ }
+ }
+
+--
+2.42.0
+