Commit aa70f36f authored by Mark Brown's avatar Mark Brown

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
parents dc60b67d bc424273
...@@ -438,8 +438,8 @@ void snd_sof_handle_fw_exception(struct snd_sof_dev *sdev, const char *msg) ...@@ -438,8 +438,8 @@ void snd_sof_handle_fw_exception(struct snd_sof_dev *sdev, const char *msg)
/* should we prevent DSP entering D3 ? */ /* should we prevent DSP entering D3 ? */
if (!sdev->ipc_dump_printed) if (!sdev->ipc_dump_printed)
dev_info(sdev->dev, dev_info(sdev->dev,
"preventing DSP entering D3 state to preserve context\n"); "Attempting to prevent DSP from entering D3 state to preserve context\n");
pm_runtime_get_noresume(sdev->dev); pm_runtime_get_if_in_use(sdev->dev);
} }
/* dump vital information to the logs */ /* dump vital information to the logs */
......
...@@ -643,16 +643,17 @@ static int sof_pcm_probe(struct snd_soc_component *component) ...@@ -643,16 +643,17 @@ static int sof_pcm_probe(struct snd_soc_component *component)
"%s/%s", "%s/%s",
plat_data->tplg_filename_prefix, plat_data->tplg_filename_prefix,
plat_data->tplg_filename); plat_data->tplg_filename);
if (!tplg_filename) if (!tplg_filename) {
return -ENOMEM; ret = -ENOMEM;
goto pm_error;
}
ret = snd_sof_load_topology(component, tplg_filename); ret = snd_sof_load_topology(component, tplg_filename);
if (ret < 0) { if (ret < 0)
dev_err(component->dev, "error: failed to load DSP topology %d\n", dev_err(component->dev, "error: failed to load DSP topology %d\n",
ret); ret);
return ret;
}
pm_error:
pm_runtime_mark_last_busy(component->dev); pm_runtime_mark_last_busy(component->dev);
pm_runtime_put_autosuspend(component->dev); pm_runtime_put_autosuspend(component->dev);
......
...@@ -218,12 +218,7 @@ static ssize_t sof_probes_dfs_points_read(struct file *file, char __user *to, ...@@ -218,12 +218,7 @@ static ssize_t sof_probes_dfs_points_read(struct file *file, char __user *to,
ret = ipc->points_info(cdev, &desc, &num_desc); ret = ipc->points_info(cdev, &desc, &num_desc);
if (ret < 0) if (ret < 0)
goto exit; goto pm_error;
pm_runtime_mark_last_busy(dev);
err = pm_runtime_put_autosuspend(dev);
if (err < 0)
dev_err_ratelimited(dev, "debugfs read failed to idle %d\n", err);
for (i = 0; i < num_desc; i++) { for (i = 0; i < num_desc; i++) {
offset = strlen(buf); offset = strlen(buf);
...@@ -241,6 +236,13 @@ static ssize_t sof_probes_dfs_points_read(struct file *file, char __user *to, ...@@ -241,6 +236,13 @@ static ssize_t sof_probes_dfs_points_read(struct file *file, char __user *to,
ret = simple_read_from_buffer(to, count, ppos, buf, strlen(buf)); ret = simple_read_from_buffer(to, count, ppos, buf, strlen(buf));
kfree(desc); kfree(desc);
pm_error:
pm_runtime_mark_last_busy(dev);
err = pm_runtime_put_autosuspend(dev);
if (err < 0)
dev_err_ratelimited(dev, "debugfs read failed to idle %d\n", err);
exit: exit:
kfree(buf); kfree(buf);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment