Skip to content

Commit 51dde90

Browse files
ewoodevsunghan-chang
authored andcommitted
arch/arm/armv7-a: move up_set_cpu_state call to arm_start_handler
Previously, up_set_cpu_state(CPU_RUNNING) was called in up_cpu_on() before sending SGI1. This caused the CPU state to be updated even when the target CPU failed to receive SGI1 and did not actually start. Move up_set_cpu_state() to arm_start_handler(), which is the SGI1 handler executed on the target CPU, ensuring the state is only updated after the CPU has successfully started. Signed-off-by: Eunwoo Nam <eunwoo.nam@samsung.com>
1 parent b0de157 commit 51dde90

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

os/arch/arm/src/armv7-a/arm_cpuon.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ int arm_start_handler(int irq, void *context, void *arg)
111111

112112
svdbg("CPU%d Started\n", this_cpu());
113113

114+
#ifdef CONFIG_CPU_HOTPLUG
115+
up_set_cpu_state(this_cpu(), CPU_RUNNING);
116+
#endif
117+
114118
#ifdef CONFIG_SCHED_INSTRUMENTATION
115119
/* Notify that this CPU has started */
116120

@@ -190,10 +194,6 @@ int up_cpu_on(int cpu)
190194
sched_note_cpu_start(this_task(), cpu);
191195
#endif
192196

193-
#ifdef CONFIG_CPU_HOTPLUG
194-
up_set_cpu_state(cpu, CPU_RUNNING);
195-
#endif
196-
197197
/* Execute SGI1 */
198198
ret = arm_cpu_sgi(GIC_IRQ_SGI1, (1 << cpu));
199199
if (ret < 0) {

0 commit comments

Comments
 (0)