Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 32 additions & 5 deletions sound/soc/sof/debug-dsp-ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,13 @@ static int sof_dsp_ops_set_power_state(struct snd_sof_dev *sdev, char *state)

static int sof_dsp_ops_trace_init(struct snd_sof_dev *sdev, bool init)
{
if (init)
if (init) {
sdev->fw_trace_is_supported = true;
return sof_fw_trace_init(sdev);
}

sof_fw_trace_free(sdev);
sdev->fw_trace_is_supported = false;
return 0;
}

Expand Down Expand Up @@ -234,13 +237,37 @@ static ssize_t sof_dsp_ops_tester_dfs_write(struct file *file, const char __user
struct snd_sof_dev *sdev = dfse->sdev;
size_t size;
char *string;
int ret;

if (!strcmp(dentry->d_name.name, "init_trace")) {
string = kzalloc(count + 1, GFP_KERNEL);
if (!string)
return -ENOMEM;

if (!strcmp(dentry->d_name.name, "init_trace"))
return sof_dsp_ops_trace_init(sdev, true);
size = simple_write_to_buffer(string, count, ppos, buffer, count);
kfree(string);

ret = sof_dsp_ops_trace_init(sdev, true);
if (ret < 0)
return ret;

return size;
}

if (!strcmp(dentry->d_name.name, "free_trace"))
return sof_dsp_ops_trace_init(sdev, false);
if (!strcmp(dentry->d_name.name, "free_trace")) {
string = kzalloc(count + 1, GFP_KERNEL);
if (!string)
return -ENOMEM;

size = simple_write_to_buffer(string, count, ppos, buffer, count);
kfree(string);

ret = sof_dsp_ops_trace_init(sdev, false);
if (ret < 0)
return ret;

return size;
}

if (!strcmp(dentry->d_name.name, "unload_fw")) {
string = kzalloc(count + 1, GFP_KERNEL);
Expand Down
2 changes: 2 additions & 0 deletions sound/soc/sof/ipc4-mtrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,8 @@ static int ipc4_mtrace_init(struct snd_sof_dev *sdev)
static void ipc4_mtrace_free(struct snd_sof_dev *sdev)
{
ipc4_mtrace_disable(sdev);
devm_kfree(sdev->dev, sdev->fw_trace_data);
sdev->fw_trace_data = NULL;
}

static int sof_ipc4_mtrace_update_pos_all_cores(struct snd_sof_dev *sdev)
Expand Down
Loading