From: Pierre-Louis Bossart Date: Fri, 27 Sep 2019 20:05:26 +0000 (-0500) Subject: ASoC: SOF: loader: fix kernel oops on firmware boot failure X-Git-Tag: v5.15~5160^2~21^2~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=798614885a0e1b867ceb0197c30c2d82575c73b0;p=platform%2Fkernel%2Flinux-starfive.git ASoC: SOF: loader: fix kernel oops on firmware boot failure When we fail to boot the firmware, we encounter a kernel oops in hda_dsp_get_registers(), which is called conditionally in hda_dsp_dump() when the sdev_>boot_complete flag is set. Setting this flag _after_ dumping the data fixes the issue and does not change the programming flow. Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20190927200538.660-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/sof/loader.c b/sound/soc/sof/loader.c index d7f3274..9a9a381 100644 --- a/sound/soc/sof/loader.c +++ b/sound/soc/sof/loader.c @@ -546,10 +546,10 @@ int snd_sof_run_firmware(struct snd_sof_dev *sdev) msecs_to_jiffies(sdev->boot_timeout)); if (ret == 0) { dev_err(sdev->dev, "error: firmware boot failure\n"); - /* after this point FW_READY msg should be ignored */ - sdev->boot_complete = true; snd_sof_dsp_dbg_dump(sdev, SOF_DBG_REGS | SOF_DBG_MBOX | SOF_DBG_TEXT | SOF_DBG_PCI); + /* after this point FW_READY msg should be ignored */ + sdev->boot_complete = true; return -EIO; }