From 0f1f9bd18db77be3ae790af024a3f01309ddb58f Mon Sep 17 00:00:00 2001 From: Piotr Szczepanik Date: Fri, 30 Oct 2020 22:58:54 +0100 Subject: [PATCH] Revert resolving supplies after creating regulator for rockchip64-current With the reverted commit rk3399 boards do not boot as rk808 fails to be probed. https://github.com/torvalds/linux/commit/aea6cb99703e17019e025aa71643b4d3e0a24413 --- ...eral-resolve-regulator-before-create.patch | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 patch/kernel/rockchip64-current/general-resolve-regulator-before-create.patch diff --git a/patch/kernel/rockchip64-current/general-resolve-regulator-before-create.patch b/patch/kernel/rockchip64-current/general-resolve-regulator-before-create.patch new file mode 100644 index 000000000..bc0bb01e1 --- /dev/null +++ b/patch/kernel/rockchip64-current/general-resolve-regulator-before-create.patch @@ -0,0 +1,38 @@ +This patch reverts https://github.com/torvalds/linux/commit/aea6cb99703e17019e025aa71643b4d3e0a24413 +that got backported into both 5.8.17 and 5.9.2 + +Without it rk808 used by all rk3399 boards fails to be probed. + +diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c +index dababe5b7..18f6d04cd 100644 +--- a/drivers/regulator/core.c ++++ b/drivers/regulator/core.c +@@ -5187,20 +5187,15 @@ regulator_register(const struct regulator_desc *regulator_desc, + else if (regulator_desc->supply_name) + rdev->supply_name = regulator_desc->supply_name; + ++ /* ++ * Attempt to resolve the regulator supply, if specified, ++ * but don't return an error if we fail because we will try ++ * to resolve it again later as more regulators are added. ++ */ ++ if (regulator_resolve_supply(rdev)) ++ rdev_dbg(rdev, "unable to resolve supply\n"); ++ + ret = set_machine_constraints(rdev, constraints); +- if (ret == -EPROBE_DEFER) { +- /* Regulator might be in bypass mode and so needs its supply +- * to set the constraints */ +- /* FIXME: this currently triggers a chicken-and-egg problem +- * when creating -SUPPLY symlink in sysfs to a regulator +- * that is just being created */ +- ret = regulator_resolve_supply(rdev); +- if (!ret) +- ret = set_machine_constraints(rdev, constraints); +- else +- rdev_dbg(rdev, "unable to resolve supply early: %pe\n", +- ERR_PTR(ret)); +- } + if (ret < 0) + goto wash; +