ASoC: SOF: ipc: Make the error prints consistent in tx_wait_done()

If we get an error on reply (msg->reply_error) then we should print the
error value out.

At the same time extend the print to include the message size as well and
do the same in case of a timeout.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210928073615.29574-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Peter Ujfalusi 2021-09-28 10:36:15 +03:00 committed by Mark Brown
parent 18845128f5
commit b689d81b16
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 6 additions and 4 deletions

View File

@ -249,15 +249,17 @@ static int tx_wait_done(struct snd_sof_ipc *ipc, struct snd_sof_ipc_msg *msg,
msecs_to_jiffies(sdev->ipc_timeout)); msecs_to_jiffies(sdev->ipc_timeout));
if (ret == 0) { if (ret == 0) {
dev_err(sdev->dev, "error: ipc timed out for 0x%x size %d\n", dev_err(sdev->dev,
hdr->cmd, hdr->size); "ipc tx timed out for %#x (msg/reply size: %d/%zu)\n",
hdr->cmd, hdr->size, msg->reply_size);
snd_sof_handle_fw_exception(ipc->sdev); snd_sof_handle_fw_exception(ipc->sdev);
ret = -ETIMEDOUT; ret = -ETIMEDOUT;
} else { } else {
ret = msg->reply_error; ret = msg->reply_error;
if (ret < 0) { if (ret < 0) {
dev_err(sdev->dev, "error: ipc error for 0x%x size %zu\n", dev_err(sdev->dev,
hdr->cmd, msg->reply_size); "ipc tx error for %#x (msg/reply size: %d/%zu): %d\n",
hdr->cmd, hdr->size, msg->reply_size, ret);
} else { } else {
ipc_log_header(sdev->dev, "ipc tx succeeded", hdr->cmd); ipc_log_header(sdev->dev, "ipc tx succeeded", hdr->cmd);
if (msg->reply_size) if (msg->reply_size)