[Sound-open-firmware] [PATCH] sof: Turn IRQs off globally when send command to pipeline component
Wu Zhigang
zhigang.wu at linux.intel.com
Tue Mar 27 11:17:13 CEST 2018
When pipeline processing the command, we have to turn off the IRQs.
If not, the DMA IRQ will interrupt the pipeline state set process,
when pipeline is scheduled, the states inconsistence will cause xrun.
Signed-off-by: Wu Zhigang <zhigang.wu at linux.intel.com>
---
Tested with
apl-gpmrb board
kernel: https://github.com/plbossart/sound.git branch: topic/sof-v4.14
95d77adbaadc44b28c8975a3714f70824d1a8529
firmware: git://git.alsa-project.org/sound-open-firmware.git branch: 1.1-stable
210989dffeea811de2370fccb7cf5d53106b1e6e
tools: branch: 1.1-stable
cc91c73aa3e91eea35abdeb76d578b97f718feff
---
src/audio/pipeline.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/audio/pipeline.c b/src/audio/pipeline.c
index 1b7f248..23be503 100644
--- a/src/audio/pipeline.c
+++ b/src/audio/pipeline.c
@@ -627,6 +627,7 @@ int pipeline_cmd(struct pipeline *p, struct comp_dev *host, int cmd,
{
struct op_data op_data;
int ret;
+ uint32_t flags;
trace_pipe("cmd");
@@ -635,7 +636,7 @@ int pipeline_cmd(struct pipeline *p, struct comp_dev *host, int cmd,
op_data.cmd = cmd;
op_data.cmd_data = data;
- spin_lock(&p->lock);
+ spin_lock_irq(&p->lock, flags);
if (host->params.direction == SOF_IPC_STREAM_PLAYBACK) {
/* send cmd downstream from host to DAI */
@@ -651,7 +652,7 @@ int pipeline_cmd(struct pipeline *p, struct comp_dev *host, int cmd,
trace_error_value(cmd);
}
- spin_unlock(&p->lock);
+ spin_unlock_irq(&p->lock, flags);
return ret;
}
--
2.11.0
More information about the Sound-open-firmware
mailing list