Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sound/soc/sof/intel/bdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion sound/soc/sof/intel/byt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion sound/soc/sof/intel/cnl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion sound/soc/sof/intel/hda-ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/sof/intel/hsw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
10 changes: 4 additions & 6 deletions sound/soc/sof/ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@keyonjie could you explain where those low 16 bits of IPC commands, masked by SOF_IPC_MESSAGE_ID(), are actually set? I've searched through both the driver and the firmware IPC code and see a few locations, where those bits are read and checked, but I don't see them anywhere being set?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lyakh they are actually not set(0s low 16 bits for all IPCs), so that's the problem I reported here: #516

Here my RFC PR try to remove comparing of this message ID(it is a wrong usage as all comparing were success here actually).

if ((msg->header & mask) == header)
return msg;
}

Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/sof/sof-priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down