ASoC: SOF: intel: hda-loader: Use snd_sof_dsp_dbg_dump() for DSP dump

Do not call directly the hda_dsp_dump(), use the generic wrapper instead
to provide consistent output.

Mark the DSP dumps as optional to not spam the kernel log with the
exception of the last dump in case the DSP fails to run.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-10-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Peter Ujfalusi 2021-10-06 14:06:35 +03:00 committed by Mark Brown
parent 34346a383d
commit 0ecaa2fff2
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -177,13 +177,19 @@ static int cl_dsp_init(struct snd_sof_dev *sdev, int stream_tag)
__func__);
err:
flags = SOF_DBG_DUMP_REGS | SOF_DBG_DUMP_PCI | SOF_DBG_DUMP_MBOX;
flags = SOF_DBG_DUMP_REGS | SOF_DBG_DUMP_PCI | SOF_DBG_DUMP_MBOX |
SOF_DBG_DUMP_OPTIONAL;
/* force error log level after max boot attempts */
if (hda->boot_iteration == HDA_FW_BOOT_ATTEMPTS)
/*
* after max boot attempts make sure that the dump is printed and error
* log level is used
*/
if (hda->boot_iteration == HDA_FW_BOOT_ATTEMPTS) {
flags |= SOF_DBG_DUMP_FORCE_ERR_LEVEL;
flags &= ~SOF_DBG_DUMP_OPTIONAL;
}
hda_dsp_dump(sdev, flags);
snd_sof_dsp_dbg_dump(sdev, flags);
snd_sof_dsp_core_power_down(sdev, chip->host_managed_cores_mask);
return ret;
@ -414,8 +420,8 @@ int hda_dsp_cl_boot_firmware(struct snd_sof_dev *sdev)
if (!ret) {
dev_dbg(sdev->dev, "Firmware download successful, booting...\n");
} else {
hda_dsp_dump(sdev, SOF_DBG_DUMP_REGS | SOF_DBG_DUMP_PCI | SOF_DBG_DUMP_MBOX |
SOF_DBG_DUMP_FORCE_ERR_LEVEL);
snd_sof_dsp_dbg_dump(sdev, SOF_DBG_DUMP_REGS | SOF_DBG_DUMP_PCI |
SOF_DBG_DUMP_MBOX | SOF_DBG_DUMP_FORCE_ERR_LEVEL);
dev_err(sdev->dev, "error: load fw failed ret: %d\n", ret);
}