Skip to content

Commit a69270d

Browse files
kv2019ibroonie
authored andcommitted
ASoC: SOF: fix race in FW boot timeout handling
A race condition exists in handling firmware boot timeout. If FW sends FW_READY just after boot timeout has expired in driver, a kernel exception will result as FW_READY handler will be run while the state is still being cleaned up in snd_sof_run_firmware(). Avoid the race by setting boot_complete also in the error case. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 8d01c3c commit a69270d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎sound/soc/sof/loader.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,8 @@ int snd_sof_run_firmware(struct snd_sof_dev *sdev)
372372
msecs_to_jiffies(sdev->boot_timeout));
373373
if (ret == 0) {
374374
dev_err(sdev->dev, "error: firmware boot failure\n");
375+
/* after this point FW_READY msg should be ignored */
376+
sdev->boot_complete = true;
375377
snd_sof_dsp_dbg_dump(sdev, SOF_DBG_REGS | SOF_DBG_MBOX |
376378
SOF_DBG_TEXT | SOF_DBG_PCI);
377379
return -EIO;

0 commit comments

Comments
 (0)