Skip to content

Commit d696d8f

Browse files
authored
Merge pull request #104 from zhigang-wu/topic/platform-stable1
pipeline:make the IPC API atomic.
2 parents 56c91cc + d04c1f7 commit d696d8f

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

src/audio/pipeline.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -605,13 +605,14 @@ int pipeline_prepare(struct pipeline *p, struct comp_dev *dev)
605605
{
606606
struct op_data op_data;
607607
int ret = -1;
608+
uint32_t flags;
608609

609610
trace_pipe("pre");
610611

611612
op_data.p = p;
612613
op_data.op = COMP_OPS_PREPARE;
613614

614-
spin_lock(&p->lock);
615+
spin_lock_irq(&p->lock, flags);
615616

616617
/* playback pipelines can be preloaded from host before trigger */
617618
if (dev->params.direction == SOF_IPC_STREAM_PLAYBACK) {
@@ -632,7 +633,7 @@ int pipeline_prepare(struct pipeline *p, struct comp_dev *dev)
632633
}
633634

634635
out:
635-
spin_unlock(&p->lock);
636+
spin_unlock_irq(&p->lock, flags);
636637
return ret;
637638
}
638639

@@ -687,13 +688,14 @@ int pipeline_params(struct pipeline *p, struct comp_dev *host,
687688
{
688689
struct op_data op_data;
689690
int ret;
691+
uint32_t flags;
690692

691693
trace_pipe("Par");
692694

693695
op_data.p = p;
694696
op_data.op = COMP_OPS_PARAMS;
695697

696-
spin_lock(&p->lock);
698+
spin_lock_irq(&p->lock, flags);
697699

698700
host->params = params->params;
699701

@@ -710,7 +712,7 @@ int pipeline_params(struct pipeline *p, struct comp_dev *host,
710712
trace_error_value(host->comp.id);
711713
}
712714

713-
spin_unlock(&p->lock);
715+
spin_unlock_irq(&p->lock, flags);
714716
return ret;
715717
}
716718

@@ -719,13 +721,14 @@ int pipeline_reset(struct pipeline *p, struct comp_dev *host)
719721
{
720722
struct op_data op_data;
721723
int ret;
724+
uint32_t flags;
722725

723726
trace_pipe("PRe");
724727

725728
op_data.p = p;
726729
op_data.op = COMP_OPS_RESET;
727730

728-
spin_lock(&p->lock);
731+
spin_lock_irq(&p->lock, flags);
729732

730733
if (host->params.direction == SOF_IPC_STREAM_PLAYBACK) {
731734
/* send reset downstream from host to DAI */
@@ -740,7 +743,7 @@ int pipeline_reset(struct pipeline *p, struct comp_dev *host)
740743
trace_error_value(host->comp.id);
741744
}
742745

743-
spin_unlock(&p->lock);
746+
spin_unlock_irq(&p->lock, flags);
744747
return ret;
745748
}
746749

0 commit comments

Comments
 (0)