mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
* [PATCH] ARM: meson: keep reset control around
@ 2026-05-22  8:35 Philipp Zabel
  2026-05-22  8:54 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Philipp Zabel @ 2026-05-22  8:35 UTC (permalink / raw)
  To: Kevin Hilman
  Cc: Jerome Brunet, Martin Blumenstingl, Bartosz Golaszewski,
	Heiko Stuebner, Steven Price, linux-arm-kernel, linux-amlogic,
	Philipp Zabel

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@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


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-22  8:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-22  8:35 [PATCH] ARM: meson: keep reset control around Philipp Zabel
2026-05-22  8:54 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome