mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-12 16:58:53 +00:00
ASoC: SOF: Print the dbg_dump and ipc_dump once to reduce kernel log noise
Do not print the dump more than once to keep the kernel log cleaner in case of a firmware failure. When the DSP is rebooted due to suspend or runtime_suspend reset the flags to re-enable the dump prints. Add also a debug flag to print all dumps to get more coverage if needed. 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-5-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
3f7561f741
commit
9ff90859b9
@ -827,7 +827,9 @@ void snd_sof_handle_fw_exception(struct snd_sof_dev *sdev)
|
||||
if (IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_RETAIN_DSP_CONTEXT) ||
|
||||
(sof_core_debug & SOF_DBG_RETAIN_CTX)) {
|
||||
/* should we prevent DSP entering D3 ? */
|
||||
dev_info(sdev->dev, "info: preventing DSP entering D3 state to preserve context\n");
|
||||
if (!sdev->ipc_dump_printed)
|
||||
dev_info(sdev->dev,
|
||||
"preventing DSP entering D3 state to preserve context\n");
|
||||
pm_runtime_get_noresume(sdev->dev);
|
||||
}
|
||||
|
||||
|
@ -791,6 +791,10 @@ int snd_sof_run_firmware(struct snd_sof_dev *sdev)
|
||||
|
||||
init_waitqueue_head(&sdev->boot_wait);
|
||||
|
||||
/* (re-)enable dsp dump */
|
||||
sdev->dbg_dump_printed = false;
|
||||
sdev->ipc_dump_printed = false;
|
||||
|
||||
/* create read-only fw_version debugfs to store boot version info */
|
||||
if (sdev->first_boot) {
|
||||
ret = snd_sof_debugfs_buf_item(sdev, &sdev->fw_version,
|
||||
|
@ -243,19 +243,23 @@ snd_sof_dsp_set_power_state(struct snd_sof_dev *sdev,
|
||||
/* debug */
|
||||
static inline void snd_sof_dsp_dbg_dump(struct snd_sof_dev *sdev, u32 flags)
|
||||
{
|
||||
if (sof_ops(sdev)->dbg_dump) {
|
||||
if (sof_ops(sdev)->dbg_dump && !sdev->dbg_dump_printed) {
|
||||
dev_err(sdev->dev, "------------[ DSP dump start ]------------\n");
|
||||
sof_ops(sdev)->dbg_dump(sdev, flags);
|
||||
dev_err(sdev->dev, "------------[ DSP dump end ]------------\n");
|
||||
if (!(sof_core_debug & SOF_DBG_PRINT_ALL_DUMPS))
|
||||
sdev->dbg_dump_printed = true;
|
||||
}
|
||||
}
|
||||
|
||||
static inline void snd_sof_ipc_dump(struct snd_sof_dev *sdev)
|
||||
{
|
||||
if (sof_ops(sdev)->ipc_dump) {
|
||||
if (sof_ops(sdev)->ipc_dump && !sdev->ipc_dump_printed) {
|
||||
dev_err(sdev->dev, "------------[ IPC dump start ]------------\n");
|
||||
sof_ops(sdev)->ipc_dump(sdev);
|
||||
dev_err(sdev->dev, "------------[ IPC dump end ]------------\n");
|
||||
if (!(sof_core_debug & SOF_DBG_PRINT_ALL_DUMPS))
|
||||
sdev->ipc_dump_printed = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,6 +33,7 @@
|
||||
#define SOF_DBG_DISABLE_MULTICORE BIT(5) /* schedule all pipelines/widgets
|
||||
* on primary core
|
||||
*/
|
||||
#define SOF_DBG_PRINT_ALL_DUMPS BIT(6) /* Print all ipc and dsp dumps */
|
||||
|
||||
#define SOF_DBG_DUMP_REGS BIT(0)
|
||||
#define SOF_DBG_DUMP_MBOX BIT(1)
|
||||
@ -421,6 +422,8 @@ struct snd_sof_dev {
|
||||
/* debug */
|
||||
struct dentry *debugfs_root;
|
||||
struct list_head dfsentry_list;
|
||||
bool dbg_dump_printed;
|
||||
bool ipc_dump_printed;
|
||||
|
||||
/* firmware loader */
|
||||
struct snd_dma_buffer dmab;
|
||||
|
Loading…
x
Reference in New Issue
Block a user