diff --git a/sound/soc/sof/intel/bdw.c b/sound/soc/sof/intel/bdw.c index f6eb51605f7a6d..a83eb7f11b4aa7 100644 --- a/sound/soc/sof/intel/bdw.c +++ b/sound/soc/sof/intel/bdw.c @@ -280,7 +280,7 @@ static irqreturn_t bdw_irq_thread(int irq, void *context) * because the done bit can't be set in cmd_done function * which is triggered by msg */ - if (snd_sof_ipc_reply(sdev, ipcx)) + if (snd_sof_ipc_reply(sdev, ipcx, U32_MAX)) bdw_cmd_done(sdev, SOF_IPC_DSP_REPLY); } diff --git a/sound/soc/sof/intel/byt.c b/sound/soc/sof/intel/byt.c index a6a2dfecf820ce..ef434c7ddc23dd 100644 --- a/sound/soc/sof/intel/byt.c +++ b/sound/soc/sof/intel/byt.c @@ -306,7 +306,7 @@ static irqreturn_t byt_irq_thread(int irq, void *context) * because the done bit can't be set in cmd_done function * which is triggered by msg */ - if (snd_sof_ipc_reply(sdev, ipcx)) + if (snd_sof_ipc_reply(sdev, ipcx, U32_MAX)) byt_cmd_done(sdev, SOF_IPC_DSP_REPLY); } diff --git a/sound/soc/sof/intel/cnl.c b/sound/soc/sof/intel/cnl.c index bcc9820d57968c..ae0b9e77f3c60f 100644 --- a/sound/soc/sof/intel/cnl.c +++ b/sound/soc/sof/intel/cnl.c @@ -63,7 +63,7 @@ static irqreturn_t cnl_ipc_irq_thread(int irq, void *context) * because the done bit can't be set in cmd_done function * which is triggered by msg */ - if (snd_sof_ipc_reply(sdev, msg)) + if (snd_sof_ipc_reply(sdev, msg, CNL_DSP_REG_HIPCIDA_MSG_MASK)) cnl_ipc_cmd_done(sdev, SOF_IPC_DSP_REPLY); ret = IRQ_HANDLED; diff --git a/sound/soc/sof/intel/hda-ipc.c b/sound/soc/sof/intel/hda-ipc.c index 9ddfa9e1f96868..91ad06468ba312 100644 --- a/sound/soc/sof/intel/hda-ipc.c +++ b/sound/soc/sof/intel/hda-ipc.c @@ -152,7 +152,8 @@ irqreturn_t hda_dsp_ipc_irq_thread(int irq, void *context) /* handle immediate reply from DSP core - ignore ROM messages */ if (msg != 0x1004000) - reply = snd_sof_ipc_reply(sdev, msg); + reply = snd_sof_ipc_reply(sdev, msg, + HDA_DSP_REG_HIPCI_MSG_MASK); /* * handle immediate reply from DSP core. If the msg is diff --git a/sound/soc/sof/intel/hsw.c b/sound/soc/sof/intel/hsw.c index d1c3ed9b0247d7..a091cb767e66e5 100644 --- a/sound/soc/sof/intel/hsw.c +++ b/sound/soc/sof/intel/hsw.c @@ -281,7 +281,7 @@ static irqreturn_t hsw_irq_thread(int irq, void *context) * because the done bit can't be set in cmd_done function * which is triggered by msg */ - if (snd_sof_ipc_reply(sdev, ipcx)) + if (snd_sof_ipc_reply(sdev, ipcx, U32_MAX)) hsw_cmd_done(sdev, SOF_IPC_DSP_REPLY); } diff --git a/sound/soc/sof/ipc.c b/sound/soc/sof/ipc.c index b52fee9c6c482c..7cc459b0db4810 100644 --- a/sound/soc/sof/ipc.c +++ b/sound/soc/sof/ipc.c @@ -307,15 +307,13 @@ static void ipc_tx_next_msg(struct work_struct *work) /* find original TX message from DSP reply */ static struct snd_sof_ipc_msg *sof_ipc_reply_find_msg(struct snd_sof_ipc *ipc, - u32 header) + u32 header, u32 mask) { struct snd_sof_dev *sdev = ipc->sdev; struct snd_sof_ipc_msg *msg; - header = SOF_IPC_MESSAGE_ID(header); - list_for_each_entry(msg, &ipc->reply_list, list) { - if (SOF_IPC_MESSAGE_ID(msg->header) == header) + if ((msg->header & mask) == header) return msg; } @@ -356,11 +354,11 @@ void sof_ipc_drop_all(struct snd_sof_ipc *ipc) EXPORT_SYMBOL(sof_ipc_drop_all); /* handle reply message from DSP */ -int snd_sof_ipc_reply(struct snd_sof_dev *sdev, u32 msg_id) +int snd_sof_ipc_reply(struct snd_sof_dev *sdev, u32 msg_id, u32 msg_mask) { struct snd_sof_ipc_msg *msg; - msg = sof_ipc_reply_find_msg(sdev->ipc, msg_id); + msg = sof_ipc_reply_find_msg(sdev->ipc, msg_id, msg_mask); if (!msg) { dev_err(sdev->dev, "error: can't find message header 0x%x", msg_id); diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h index d704cc5c0969ab..9c254bd690397a 100644 --- a/sound/soc/sof/sof-priv.h +++ b/sound/soc/sof/sof-priv.h @@ -416,7 +416,7 @@ int snd_sof_fw_parse_ext_data(struct snd_sof_dev *sdev, u32 offset); */ struct snd_sof_ipc *snd_sof_ipc_init(struct snd_sof_dev *sdev); void snd_sof_ipc_free(struct snd_sof_dev *sdev); -int snd_sof_ipc_reply(struct snd_sof_dev *sdev, u32 msg_id); +int snd_sof_ipc_reply(struct snd_sof_dev *sdev, u32 msg_id, u32 msg_mask); void snd_sof_ipc_msgs_rx(struct snd_sof_dev *sdev); void snd_sof_ipc_msgs_tx(struct snd_sof_dev *sdev); int snd_sof_ipc_stream_pcm_params(struct snd_sof_dev *sdev,