ASoC: SOF: ipc4: Dump the payload also when set_get_data fails
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Thu, 14 Sep 2023 12:51:15 +0000 (15:51 +0300)
committerMark Brown <broonie@kernel.org>
Thu, 14 Sep 2023 14:56:56 +0000 (15:56 +0100)
Move the out label to dump the message payload when the IPC message fails.
The payload contains important information on what might have caused the
error in firmware.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230914125115.30904-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/ipc4.c

index ab6eddd91bb771d123fef91cf22b3375db8f48f5..9744627d697800d3e3c42a597507a3f396196fa8 100644 (file)
@@ -513,10 +513,10 @@ static int sof_ipc4_set_get_data(struct snd_sof_dev *sdev, void *data,
        if (!set && payload_bytes != offset)
                ipc4_msg->data_size = offset;
 
+out:
        if (sof_debug_check_flag(SOF_DBG_DUMP_IPC_MESSAGE_PAYLOAD))
                sof_ipc4_dump_payload(sdev, ipc4_msg->data_ptr, ipc4_msg->data_size);
 
-out:
        mutex_unlock(&sdev->ipc->tx_mutex);
 
        return ret;