diff options
Diffstat (limited to 'chip')
-rw-r--r-- | chip/mt8192_scp/ipi.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/chip/mt8192_scp/ipi.c b/chip/mt8192_scp/ipi.c index e8aadb4165..2f67f7fa14 100644 --- a/chip/mt8192_scp/ipi.c +++ b/chip/mt8192_scp/ipi.c @@ -26,12 +26,14 @@ static struct ipc_shared_obj *const ipi_recv_buf = (struct ipc_shared_obj *)(CONFIG_IPC_SHARED_OBJ_ADDR + sizeof(struct ipc_shared_obj)); -static uint32_t disable_irq_count; +static uint32_t disable_irq_count, saved_int_mask; void ipi_disable_irq(void) { - if (atomic_inc(&disable_irq_count, 1) == 0) - task_disable_irq(SCP_IRQ_GIPC_IN0); + if (atomic_inc(&disable_irq_count, 1) == 0) { + saved_int_mask = get_int_mask(); + interrupt_disable(); + } } void ipi_enable_irq(void) @@ -39,7 +41,7 @@ void ipi_enable_irq(void) if (atomic_dec(&disable_irq_count, 1) == 1) { int pending = SCP_GIPC_IN_SET; - task_enable_irq(SCP_IRQ_GIPC_IN0); + set_int_mask(saved_int_mask); if (init_done && pending) task_trigger_irq(SCP_IRQ_GIPC_IN0); |