Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+19 -16
+2 -2
sound/soc/sof/debug.c
··· 438 438 /* should we prevent DSP entering D3 ? */ 439 439 if (!sdev->ipc_dump_printed) 440 440 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); 443 443 } 444 444 445 445 /* dump vital information to the logs */
+9 -8
sound/soc/sof/pcm.c
··· 643 643 "%s/%s", 644 644 plat_data->tplg_filename_prefix, 645 645 plat_data->tplg_filename); 646 - if (!tplg_filename) 647 - return -ENOMEM; 648 - 649 - ret = snd_sof_load_topology(component, tplg_filename); 650 - if (ret < 0) { 651 - dev_err(component->dev, "error: failed to load DSP topology %d\n", 652 - ret); 653 - return ret; 646 + if (!tplg_filename) { 647 + ret = -ENOMEM; 648 + goto pm_error; 654 649 } 655 650 651 + ret = snd_sof_load_topology(component, tplg_filename); 652 + if (ret < 0) 653 + dev_err(component->dev, "error: failed to load DSP topology %d\n", 654 + ret); 655 + 656 + pm_error: 656 657 pm_runtime_mark_last_busy(component->dev); 657 658 pm_runtime_put_autosuspend(component->dev); 658 659
+8 -6
sound/soc/sof/sof-client-probes.c
··· 218 218 219 219 ret = ipc->points_info(cdev, &desc, &num_desc); 220 220 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; 227 222 228 223 for (i = 0; i < num_desc; i++) { 229 224 offset = strlen(buf); ··· 236 241 ret = simple_read_from_buffer(to, count, ppos, buf, strlen(buf)); 237 242 238 243 kfree(desc); 244 + 245 + pm_error: 246 + pm_runtime_mark_last_busy(dev); 247 + err = pm_runtime_put_autosuspend(dev); 248 + if (err < 0) 249 + dev_err_ratelimited(dev, "debugfs read failed to idle %d\n", err); 250 + 239 251 exit: 240 252 kfree(buf); 241 253 return ret;