Skip to content

Commit aa70f36

Browse files
committed
ASoC: SOF: Various runtime pm fixes, improvements
Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>: Three patch to correct error path PM runtime handling in few places. Regards, Peter --- Pierre-Louis Bossart (3): ASoC: SOF: debug: conditionally bump runtime_pm counter on exceptions ASoC: SOF: pcm: fix pm_runtime imbalance in error handling ASoC: SOF: sof-client-probes: fix pm_runtime imbalance in error handling sound/soc/sof/debug.c | 4 ++-- sound/soc/sof/pcm.c | 11 ++++++----- sound/soc/sof/sof-client-probes.c | 14 ++++++++------ 3 files changed, 16 insertions(+), 13 deletions(-) -- 2.40.1
2 parents dc60b67 + bc42427 commit aa70f36

3 files changed

Lines changed: 16 additions & 13 deletions

File tree

sound/soc/sof/debug.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,8 +438,8 @@ void snd_sof_handle_fw_exception(struct snd_sof_dev *sdev, const char *msg)
438438
/* should we prevent DSP entering D3 ? */
439439
if (!sdev->ipc_dump_printed)
440440
dev_info(sdev->dev,
441-
"preventing DSP entering D3 state to preserve context\n");
442-
pm_runtime_get_noresume(sdev->dev);
441+
"Attempting to prevent DSP from entering D3 state to preserve context\n");
442+
pm_runtime_get_if_in_use(sdev->dev);
443443
}
444444

445445
/* dump vital information to the logs */

sound/soc/sof/pcm.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -643,16 +643,17 @@ static int sof_pcm_probe(struct snd_soc_component *component)
643643
"%s/%s",
644644
plat_data->tplg_filename_prefix,
645645
plat_data->tplg_filename);
646-
if (!tplg_filename)
647-
return -ENOMEM;
646+
if (!tplg_filename) {
647+
ret = -ENOMEM;
648+
goto pm_error;
649+
}
648650

649651
ret = snd_sof_load_topology(component, tplg_filename);
650-
if (ret < 0) {
652+
if (ret < 0)
651653
dev_err(component->dev, "error: failed to load DSP topology %d\n",
652654
ret);
653-
return ret;
654-
}
655655

656+
pm_error:
656657
pm_runtime_mark_last_busy(component->dev);
657658
pm_runtime_put_autosuspend(component->dev);
658659

sound/soc/sof/sof-client-probes.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,7 @@ static ssize_t sof_probes_dfs_points_read(struct file *file, char __user *to,
218218

219219
ret = ipc->points_info(cdev, &desc, &num_desc);
220220
if (ret < 0)
221-
goto exit;
222-
223-
pm_runtime_mark_last_busy(dev);
224-
err = pm_runtime_put_autosuspend(dev);
225-
if (err < 0)
226-
dev_err_ratelimited(dev, "debugfs read failed to idle %d\n", err);
221+
goto pm_error;
227222

228223
for (i = 0; i < num_desc; i++) {
229224
offset = strlen(buf);
@@ -241,6 +236,13 @@ static ssize_t sof_probes_dfs_points_read(struct file *file, char __user *to,
241236
ret = simple_read_from_buffer(to, count, ppos, buf, strlen(buf));
242237

243238
kfree(desc);
239+
240+
pm_error:
241+
pm_runtime_mark_last_busy(dev);
242+
err = pm_runtime_put_autosuspend(dev);
243+
if (err < 0)
244+
dev_err_ratelimited(dev, "debugfs read failed to idle %d\n", err);
245+
244246
exit:
245247
kfree(buf);
246248
return ret;

0 commit comments

Comments
 (0)