Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
To pause the cpu, cpu should call `up_cpu_paused`. The call to `up_cpu_paused` will get missed when `g_cpu_irqlock` is unlocked (means none of the cpu having access to irqlock), `arm_pause_handler` rely on `enter_critical_section` to pause the cpu, it must handle `up_cpu_pausereq` without any fail, otherwise other cpu will wait forever in spinlock. Change `while` loop to `do-while` loop in `irq_waitlock`, which will ensure there is no pending `up_cpu_pausereq` before getting lock on `g_cpu_irqlock` otherwise pause request will get missed. The `SP_DMB` is needed to ensure both cpu read correct spinlock value. The `spin_lock(&g_cpu_resumed[cpu])` is moved upward in code to avoid race condition between cpus.
- Loading branch information