build/patch/kernel/archive/sunxi-6.4/patches.megous/regulator-rk808-revert-to-synchronous-probing.patch

44 lines
1.7 KiB
Diff

From ae2926ebbc9afff8f7546dfb6b0d35cbf1fca645 Mon Sep 17 00:00:00 2001
From: Sebastian Reichel <sebastian.reichel@collabora.com>
Date: Thu, 4 May 2023 16:11:48 +0200
Subject: [PATCH 311/469] regulator: rk808: revert to synchronous probing
The rk808 driver registers a bunch of regulator devices in a loop.
If one of the later regulators fails to register (usually because
its input supply is not yet available) everything will be unrolled
(i.e. previously registered regulators will be unregistered). With
asynchronous registration there might already be consumers, though.
We do not have the necessary infrastructure to properly unregister
the consumer device, so this scenario should be avoided.
First checking all input supplies or disallowing usage of the regulators
until all are registered does not work, since there can be
self-references (e.g. DCDC channels providing the supply of LDOs).
The only sensible solution I found is registering the regulator devices
asynchronously, so that we do not have to unroll. Since this is a major
rework let's revert back to synchronous probing for now to fix the issue
at hand.
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
drivers/regulator/rk808-regulator.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/regulator/rk808-regulator.c b/drivers/regulator/rk808-regulator.c
index 71a1ca8b917e..5f14d6dd4593 100644
--- a/drivers/regulator/rk808-regulator.c
+++ b/drivers/regulator/rk808-regulator.c
@@ -1355,7 +1355,7 @@ static struct platform_driver rk808_regulator_driver = {
.probe = rk808_regulator_probe,
.driver = {
.name = "rk808-regulator",
- .probe_type = PROBE_PREFER_ASYNCHRONOUS,
+ .probe_type = PROBE_FORCE_SYNCHRONOUS,
},
};
--
2.34.1