Skip to content

Commit

Permalink
ASoC: SOF: add FW panic support on CAVS platforms
Browse files Browse the repository at this point in the history
Get the FW panic information from telemetry data in memory window and
dump it to kernel log.

Signed-off-by: Rander Wang <[email protected]>
  • Loading branch information
RanderWang committed Aug 16, 2023
1 parent 8559659 commit d848e98
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions sound/soc/sof/intel/hda.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "../sof-pci-dev.h"
#include "../ops.h"
#include "hda.h"
#include "telemetry.h"

#define CREATE_TRACE_POINTS
#include <trace/events/sof_intel.h>
Expand Down Expand Up @@ -720,6 +721,19 @@ void hda_dsp_dump(struct snd_sof_dev *sdev, u32 flags)
}
}

void hda_ipc4_dsp_dump(struct snd_sof_dev *sdev, u32 flags)
{
char *level = (flags & SOF_DBG_DUMP_OPTIONAL) ? KERN_DEBUG : KERN_ERR;

/* print ROM/FW status */
hda_dsp_get_state(sdev, level);

if (flags & SOF_DBG_DUMP_REGS)
sof_ipc4_intel_dump_telemetry_state(sdev, flags);
else
hda_dsp_dump_ext_rom_status(sdev, level, flags);
}

static bool hda_check_ipc_irq(struct snd_sof_dev *sdev)
{
const struct sof_intel_dsp_desc *chip;
Expand Down
1 change: 1 addition & 0 deletions sound/soc/sof/intel/hda.h
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@ int hda_dsp_shutdown_dma_flush(struct snd_sof_dev *sdev);
int hda_dsp_shutdown(struct snd_sof_dev *sdev);
int hda_dsp_set_hw_params_upon_resume(struct snd_sof_dev *sdev);
void hda_dsp_dump(struct snd_sof_dev *sdev, u32 flags);
void hda_ipc4_dsp_dump(struct snd_sof_dev *sdev, u32 flags);
void hda_ipc_dump(struct snd_sof_dev *sdev);
void hda_ipc_irq_dump(struct snd_sof_dev *sdev);
void hda_dsp_d0i3_work(struct work_struct *work);
Expand Down
1 change: 1 addition & 0 deletions sound/soc/sof/intel/tgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ int sof_tgl_ops_init(struct snd_sof_dev *sdev)

/* debug */
sof_tgl_ops.ipc_dump = cnl_ipc4_dump;
sof_tgl_ops.dbg_dump = hda_ipc4_dsp_dump;

sof_tgl_ops.set_power_state = hda_dsp_set_power_state_ipc4;
}
Expand Down

0 comments on commit d848e98

Please sign in to comment.