Skip to content

Commit 3de9758

Browse files
plbossartbroonie
authored andcommitted
ASoC: SOF: debug: conditionally bump runtime_pm counter on exceptions
When a firmware IPC error happens during a pm_runtime suspend, we ignore the error and suspend anyways. However, the code unconditionally increases the runtime_pm counter. This results in a confusing configuration where the code will suspend, resume but never suspend again due to the use of pm_runtime_get_noresume(). The intent of the counter increase was to prevent entry in D3, but if that transition to D3 is already started it cannot be stopped. In addition, there's no point in that case in trying to prevent anything, the firmware error is handled and the next resume will re-initialize the firmware completely. This patch changes the logic to prevent suspend when the device is pm_runtime active and has a use_count > 0. Signed-off-by: Pierre-Louis Bossart <[email protected] Reviewed-by: Daniel Baluta <[email protected] Reviewed-by: Ranjani Sridharan <[email protected] Signed-off-by: Peter Ujfalusi <[email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]
1 parent f63550e commit 3de9758

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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 */

0 commit comments

Comments
 (0)