-
Notifications
You must be signed in to change notification settings - Fork 590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
os: fix amp hang issue #6623
base: master
Are you sure you want to change the base?
os: fix amp hang issue #6623
Conversation
Hi @gSahitya-samsung since your commit includes my change of including DMB in arm_pause_handler, is #6619 still required? |
@gSahitya-samsung Let's split commits for @lhenry-realtek 's change. Could you cherry pick his commit here? |
3c4c758
to
6ee637a
Compare
As you know, I think, The rootcause is missed enter_critical_section in up_schedule_sigaction(). #6624 Could you please update if below commit is not needed, Please update it |
Hi @ewoodev, this commit is required, the The |
7360022
to
be35154
Compare
@@ -277,7 +278,7 @@ int arm_pause_handler(int irq, void *context, void *arg) | |||
* interrupt by calling up_cpu_paused(). If the pause event has already | |||
* been processed then g_cpu_paused[cpu] will not be locked. | |||
*/ | |||
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove this unnecessary change.
…spinlock variable is observed in ISR This commit addresses a condition where the spinlock variable becomes un-synced between cores due to out-of-order memory access. DMB is added to ensure the latest copy of the lock is retrieved before operating on it
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.
7482d8c
be35154
to
7482d8c
Compare
To pause the cpu, cpu should call
up_cpu_paused
. The call toup_cpu_paused
will get missed wheng_cpu_irqlock
is unlocked (means none of the cpu having access to irqlock),arm_pause_handler
rely onenter_critical_section
to pause the cpu, it must handleup_cpu_pausereq
without any fail, otherwise other cpu will wait forever in spinlock.Change
while
loop todo-while
loop inirq_waitlock
, which will ensure there is no pendingup_cpu_pausereq
before getting lock ong_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.