-
Notifications
You must be signed in to change notification settings - Fork 321
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
ipc4: Add preeption guard to bind/unbind #8205
ipc4: Add preeption guard to bind/unbind #8205
Conversation
f954211
to
e377686
Compare
src/ipc/ipc4/helper.c
Outdated
* This is intendent to be a temporary workaround and should be replaced with some | ||
* proper robust guard solution. | ||
*/ | ||
k_sched_lock(); | ||
irq_local_disable(flags); |
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.
do we still need irq_disable than?
Even if - we need to use irq_lock instead of "local disable"
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.
Without irq_local_disable(), timer interrupt may come and increase LL scheduler semaphore. That will not start LL scheduler because of k_shed_lock(), however, if inside comp_buffer_connect() somebody calls sleep(), then LL scheduler will start. Having irq_local_disable() will not allow timer interrupt to increase semaphore. So, its better to have irq_local_disable() at least for duration of two com_buffer_connect(). However, we cannot have interrupts disabled during comp_bind_remote() as we rely of k_shed_lock() and that nobody uses sleep() inside .bind() handler.
So k_shed_lock() is not 100% replacement for irq_local_disable() but just a good enough workaround we can quickly introduce.
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.
Even if - we need to use irq_lock instead of "local disable"
irq_local_disable(), despite its name, disables interrupts globally :)
Anyway, we'll need at some future to replace this workaround with proper guard and fix other critical bind related issues, like lack of .params() and .prepare() calls if binding to running pipeline.
SOFCI TEST |
This is a workaround to protect bind/unbind operations to be preempted by LL scheduler but still enabling IDC interrupt. Signed-off-by: Serhiy Katsyuba <[email protected]>
e377686
to
44fce74
Compare
0a8d12b
into
thesofproject:mtl-006-drop-stable
This is a workaround to protect bind/unbind operations to be preempted by LL scheduler.