From 620b1903ed94b19fe6b0e9334a04a1ef2d039707 Mon Sep 17 00:00:00 2001 From: Rander Wang Date: Mon, 20 Aug 2018 16:10:22 +0800 Subject: [PATCH] ASoC: SOF: ipc: use correct lock function in ipc function spin_lock_irq would uncondtinoally disable interrupts while spin_lock_irqsave would save the interrupt state in cases that you cannot know what state you are currently in. so spin_lock_irqsave should be used instead of spin_lock_irq in ipc_tx_next_msg. In fact the spin_lock_irqsave is used in all functions except this function. Signed-off-by: Rander Wang --- sound/soc/sof/ipc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sound/soc/sof/ipc.c b/sound/soc/sof/ipc.c index 908f6c9de85154..02ae60455a9a66 100644 --- a/sound/soc/sof/ipc.c +++ b/sound/soc/sof/ipc.c @@ -303,8 +303,9 @@ static void ipc_tx_next_msg(struct work_struct *work) container_of(work, struct snd_sof_ipc, tx_kwork); struct snd_sof_dev *sdev = ipc->sdev; struct snd_sof_ipc_msg *msg; + unsigned long flags; - spin_lock_irq(&sdev->ipc_lock); + spin_lock_irqsave(&sdev->ipc_lock, flags); /* send message if HW read and message in TX list */ if (list_empty(&ipc->tx_list) || !snd_sof_dsp_is_ready(sdev)) @@ -317,7 +318,7 @@ static void ipc_tx_next_msg(struct work_struct *work) ipc_log_header(sdev->dev, "ipc tx", msg->header); out: - spin_unlock_irq(&sdev->ipc_lock); + spin_unlock_irqrestore(&sdev->ipc_lock, flags); } /* find original TX message from DSP reply */