-
Notifications
You must be signed in to change notification settings - Fork 364
audio: copier: avoid IRQ lock/unlock in chmap code #10972
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,7 @@ | |
| #include <rtos/interrupt.h> | ||
| #include <sof/ipc/msg.h> | ||
| #include <sof/ipc/topology.h> | ||
| #include <sof/schedule/ll_schedule_domain.h> | ||
| #include <rtos/interrupt.h> | ||
| #include <rtos/timer.h> | ||
| #include <rtos/cache.h> | ||
|
|
@@ -838,7 +839,9 @@ __cold static int set_chmap(struct comp_dev *dev, const void *data, size_t data_ | |
| pcm_converter_func process; | ||
| pcm_converter_func converters[IPC4_COPIER_MODULE_OUTPUT_PINS_COUNT]; | ||
| int i; | ||
| #ifndef CONFIG_SOF_USERSPACE_LL | ||
| uint32_t irq_flags; | ||
| #endif | ||
|
|
||
| assert_can_be_cold(); | ||
|
|
||
|
|
@@ -892,15 +895,26 @@ __cold static int set_chmap(struct comp_dev *dev, const void *data, size_t data_ | |
| } | ||
| } | ||
|
|
||
| /* Atomically update chmap, process and converters */ | ||
| /* Atomically update chmap, process and converters. | ||
| * In user-space builds irq_local_disable() is privileged, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| * use the LL scheduler lock instead. | ||
| */ | ||
| #ifdef CONFIG_SOF_USERSPACE_LL | ||
| user_ll_lock_sched(dev->pipeline->core); | ||
| #else | ||
| irq_local_disable(irq_flags); | ||
| #endif | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does it actually make sense to change the copier channel map while it's already processing data? If not, if this function should only run when there's no active streaming taking place, maybe we could just put a status check in the beginning of this function and avoid locking entirely? |
||
|
|
||
| cd->dd[0]->chmap = chmap_cfg->channel_map; | ||
| cd->dd[0]->process = process; | ||
| for (i = 0; i < IPC4_COPIER_MODULE_OUTPUT_PINS_COUNT; i++) | ||
| cd->converter[i] = converters[i]; | ||
|
|
||
| #ifdef CONFIG_SOF_USERSPACE_LL | ||
| user_ll_unlock_sched(dev->pipeline->core); | ||
| #else | ||
| irq_local_enable(irq_flags); | ||
| #endif | ||
|
|
||
| return 0; | ||
| } | ||
|
|
||
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.
Not part of this PR.