Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/kernel/lib/ams.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,11 +510,11 @@ static int ams_process_slot(struct async_message_service *ams, uint32_t slot)

static void ams_task_add_slot_to_process(struct ams_task *ams_task, uint32_t slot)
{
int flags;
unsigned int key;

irq_local_disable(flags);
key = arch_irq_lock();
ams_task->pending_slots |= BIT(slot);
irq_local_enable(flags);
arch_irq_unlock(key);
}

int process_incoming_message(uint32_t slot)
Expand All @@ -535,7 +535,7 @@ static enum task_state process_message(void *arg)
{
struct ams_task *ams_task = arg;
uint32_t slot;
int flags;
unsigned int key;

if (ams_task->pending_slots == 0) {
tr_err(&ams_tr, "Could not process message! Skipping.");
Expand All @@ -547,9 +547,9 @@ static enum task_state process_message(void *arg)
ams_process_slot(ams_task->ams, slot);

/* only done on main core, irq disabling is enough */
irq_local_disable(flags);
key = arch_irq_lock();
ams_task->pending_slots &= ~BIT(slot);
irq_local_enable(flags);
arch_irq_unlock(key);
schedule_task_cancel(&ams_task->ams_task);

return SOF_TASK_STATE_COMPLETED;
Expand Down
Loading