From: Peter Ujfalusi Date: Thu, 23 Dec 2021 11:36:19 +0000 (+0200) Subject: ASoC: SOF: ipc: Only allow sending of an IPC in SOF_FW_BOOT_COMPLETE state X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=9421ff7665f66452f61ee40566c6f562d3847873;p=linux.git ASoC: SOF: ipc: Only allow sending of an IPC in SOF_FW_BOOT_COMPLETE state If the state of the firmware is not BOOT_COMPLETE, it means that the firmware is not functioning, thus it is not capable of handling IPC messages. Do not try to send IPC if the state is not BOOT_COMPLETE Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20211223113628.18582-12-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/sof/ipc.c b/sound/soc/sof/ipc.c index bbd539071ac50..5bcf906d90af2 100644 --- a/sound/soc/sof/ipc.c +++ b/sound/soc/sof/ipc.c @@ -302,7 +302,7 @@ static int sof_ipc_tx_message_unlocked(struct snd_sof_ipc *ipc, u32 header, struct snd_sof_ipc_msg *msg; int ret; - if (ipc->disable_ipc_tx || sdev->fw_state == SOF_FW_CRASHED) + if (ipc->disable_ipc_tx || sdev->fw_state != SOF_FW_BOOT_COMPLETE) return -ENODEV; /*