Skip to content

Commit ac9bbed

Browse files
authored
Merge pull request #491 from tlauda/topic/idc-comp-cmd-fix
ipc: fix condition for slave core comp cmd
2 parents af19236 + 1aed447 commit ac9bbed

1 file changed

Lines changed: 16 additions & 14 deletions

File tree

src/ipc/handler.c

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -733,21 +733,23 @@ static int ipc_comp_cmd(struct comp_dev *dev, int cmd,
733733
struct idc_msg comp_cmd_msg;
734734
int core = dev->pipeline->ipc_pipe.core;
735735

736-
/* pipeline scheduled on current core */
737-
if (cpu_get_id() == core)
736+
/* pipeline running on other core */
737+
if (dev->pipeline->status == COMP_STATE_ACTIVE &&
738+
cpu_get_id() != core) {
739+
/* check if requested core is enabled */
740+
if (!cpu_is_core_enabled(core))
741+
return -EINVAL;
742+
743+
/* build IDC message */
744+
comp_cmd_msg.header = IDC_MSG_COMP_CMD;
745+
comp_cmd_msg.extension = IDC_MSG_COMP_CMD_EXT(cmd);
746+
comp_cmd_msg.core = core;
747+
748+
/* send IDC component command message */
749+
return idc_send_msg(&comp_cmd_msg, IDC_BLOCKING);
750+
} else {
738751
return comp_cmd(dev, cmd, data);
739-
740-
/* check if requested core is enabled */
741-
if (!cpu_is_core_enabled(core))
742-
return -EINVAL;
743-
744-
/* build IDC message */
745-
comp_cmd_msg.header = IDC_MSG_COMP_CMD;
746-
comp_cmd_msg.extension = IDC_MSG_COMP_CMD_EXT(cmd);
747-
comp_cmd_msg.core = core;
748-
749-
/* send IDC component command message */
750-
return idc_send_msg(&comp_cmd_msg, IDC_BLOCKING);
752+
}
751753
}
752754

753755
/* get/set component values or runtime data */

0 commit comments

Comments
 (0)