[PATCH] ARM: meson: keep reset control around
Philipp Zabel
p.zabel at pengutronix.de
Fri May 22 01:35:48 PDT 2026
Do not put the reset control, retain exclusive control over it,
since After turning on a CPU, the corresponding reset line must
stay deasserted.
This also avoids calling reset_control_put() before workqueues
are operational.
Fixes: 78ebbff6d1a0 ("reset: handle removing supplier before consumers")
Signed-off-by: Philipp Zabel <p.zabel at pengutronix.de>
---
This should fix the same issue as the one reported at [1] and fixed by
[2] for rockchip.
[1] https://lore.kernel.org/all/20260417154809.1984386-1-steven.price@arm.com/
[2] https://lore.kernel.org/all/20260521210915.2331176-1-heiko@sntech.de/
---
arch/arm/mach-meson/platsmp.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/arch/arm/mach-meson/platsmp.c b/arch/arm/mach-meson/platsmp.c
index 32ac60b89fdc..5f18895104ed 100644
--- a/arch/arm/mach-meson/platsmp.c
+++ b/arch/arm/mach-meson/platsmp.c
@@ -34,6 +34,7 @@
static void __iomem *sram_base;
static void __iomem *scu_base;
static struct regmap *pmu;
+static struct reset_control *cpu_rstc[4];
static struct reset_control *meson_smp_get_core_reset(int cpu)
{
@@ -62,6 +63,7 @@ static void __init meson_smp_prepare_cpus(const char *scu_compatible,
const char *sram_compatible)
{
static struct device_node *node;
+ int cpu;
/* SMP SRAM */
node = of_find_compatible_node(NULL, NULL, sram_compatible);
@@ -99,6 +101,9 @@ static void __init meson_smp_prepare_cpus(const char *scu_compatible,
}
scu_enable(scu_base);
+
+ for (cpu = 0; cpu < ARRAY_SIZE(cpu_rstc); cpu++)
+ cpu_rstc[cpu] = meson_smp_get_core_reset(cpu);
}
static void __init meson8b_smp_prepare_cpus(unsigned int max_cpus)
@@ -155,10 +160,9 @@ static int meson_smp_finalize_secondary_boot(unsigned int cpu)
static int meson8_smp_boot_secondary(unsigned int cpu,
struct task_struct *idle)
{
- struct reset_control *rstc;
+ struct reset_control *rstc = cpu_rstc[cpu];
int ret;
- rstc = meson_smp_get_core_reset(cpu);
if (IS_ERR(rstc)) {
pr_err("Couldn't get the reset controller for CPU%d\n", cpu);
return PTR_ERR(rstc);
@@ -203,19 +207,16 @@ static int meson8_smp_boot_secondary(unsigned int cpu,
goto out;
out:
- reset_control_put(rstc);
-
return 0;
}
static int meson8b_smp_boot_secondary(unsigned int cpu,
struct task_struct *idle)
{
- struct reset_control *rstc;
+ struct reset_control *rstc = cpu_rstc[cpu];
int ret;
u32 val;
- rstc = meson_smp_get_core_reset(cpu);
if (IS_ERR(rstc)) {
pr_err("Couldn't get the reset controller for CPU%d\n", cpu);
return PTR_ERR(rstc);
@@ -286,8 +287,6 @@ static int meson8b_smp_boot_secondary(unsigned int cpu,
goto out;
out:
- reset_control_put(rstc);
-
return 0;
}
--
2.47.3
More information about the linux-arm-kernel
mailing list