Message ID | 20230512104638.21376-1-peter.ujfalusi@linux.intel.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 171b53be635ac15d4feafeb33946035649b1ca14 |
Headers | show |
Series | ASoC: SOF: pm: save io region state in case of errors in resume | expand |
On Fri, 12 May 2023 13:46:38 +0300, Peter Ujfalusi wrote: > If there are failures in DSP runtime resume, the device state will not > reach active and this makes it impossible e.g. to retrieve a possible > DSP panic dump via "exception" debugfs node. If > CONFIG_SND_SOC_SOF_DEBUG_ENABLE_DEBUGFS_CACHE=y is set, the data in > cache is stale. If debugfs cache is not used, the region simply cannot > be read. > > [...] Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next Thanks! [1/1] ASoC: SOF: pm: save io region state in case of errors in resume commit: 171b53be635ac15d4feafeb33946035649b1ca14 All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark
diff --git a/sound/soc/sof/pm.c b/sound/soc/sof/pm.c index 2fdbc53ca715..2b232442e84b 100644 --- a/sound/soc/sof/pm.c +++ b/sound/soc/sof/pm.c @@ -164,7 +164,7 @@ static int sof_resume(struct device *dev, bool runtime_resume) ret = tplg_ops->set_up_all_pipelines(sdev, false); if (ret < 0) { dev_err(sdev->dev, "Failed to restore pipeline after resume %d\n", ret); - return ret; + goto setup_fail; } } @@ -178,6 +178,18 @@ static int sof_resume(struct device *dev, bool runtime_resume) dev_err(sdev->dev, "ctx_restore IPC error during resume: %d\n", ret); } +setup_fail: +#if IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_ENABLE_DEBUGFS_CACHE) + if (ret < 0) { + /* + * Debugfs cannot be read in runtime suspend, so cache + * the contents upon failure. This allows to capture + * possible DSP coredump information. + */ + sof_cache_debugfs(sdev); + } +#endif + return ret; }