From a65adcd9dbb37b85f0a5f1b7f7e5fc047107ff5b Mon Sep 17 00:00:00 2001 From: hujun5 Date: Mon, 12 Aug 2024 09:16:36 +0800 Subject: [PATCH] smp: smp call handler add up_cpu_paused_[save|restore] reason: Since smp call handler may lead to context switching, we need to update the context information by calling up_cpu_paused_[save|restore]. Signed-off-by: hujun5 --- sched/sched/sched_smp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sched/sched/sched_smp.c b/sched/sched/sched_smp.c index 1b3483c71c..88ac43bfad 100644 --- a/sched/sched/sched_smp.c +++ b/sched/sched/sched_smp.c @@ -121,6 +121,7 @@ int nxsched_smp_call_handler(int irq, FAR void *context, call_queue = &g_smp_call_queue[cpu]; + up_cpu_paused_save(); sq_for_every_safe(call_queue, curr, next) { FAR struct smp_call_data_s *call_data = @@ -154,6 +155,7 @@ int nxsched_smp_call_handler(int irq, FAR void *context, flags = enter_critical_section(); } + up_cpu_paused_restore(); leave_critical_section(flags); return OK; }