ASoC: SOF: Fixes for suspend after firmware crash
Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>: This series contails 2 patches to fix device suspend after a firmware crash and another patch to allow reading the FW state from debugfs.
This commit is contained in:
commit
ce9ef749a2
|
@ -353,7 +353,9 @@ int snd_sof_dbg_init(struct snd_sof_dev *sdev)
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return snd_sof_debugfs_buf_item(sdev, &sdev->fw_state,
|
||||||
|
sizeof(sdev->fw_state),
|
||||||
|
"fw_state", 0444);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(snd_sof_dbg_init);
|
EXPORT_SYMBOL_GPL(snd_sof_dbg_init);
|
||||||
|
|
||||||
|
|
|
@ -182,7 +182,7 @@ static int sof_suspend(struct device *dev, bool runtime_suspend)
|
||||||
const struct sof_ipc_pm_ops *pm_ops = sdev->ipc->ops->pm;
|
const struct sof_ipc_pm_ops *pm_ops = sdev->ipc->ops->pm;
|
||||||
const struct sof_ipc_tplg_ops *tplg_ops = sdev->ipc->ops->tplg;
|
const struct sof_ipc_tplg_ops *tplg_ops = sdev->ipc->ops->tplg;
|
||||||
pm_message_t pm_state;
|
pm_message_t pm_state;
|
||||||
u32 target_state = 0;
|
u32 target_state = snd_sof_dsp_power_target(sdev);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* do nothing if dsp suspend callback is not set */
|
/* do nothing if dsp suspend callback is not set */
|
||||||
|
@ -192,6 +192,9 @@ static int sof_suspend(struct device *dev, bool runtime_suspend)
|
||||||
if (runtime_suspend && !sof_ops(sdev)->runtime_suspend)
|
if (runtime_suspend && !sof_ops(sdev)->runtime_suspend)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
if (tplg_ops && tplg_ops->tear_down_all_pipelines)
|
||||||
|
tplg_ops->tear_down_all_pipelines(sdev, false);
|
||||||
|
|
||||||
if (sdev->fw_state != SOF_FW_BOOT_COMPLETE)
|
if (sdev->fw_state != SOF_FW_BOOT_COMPLETE)
|
||||||
goto suspend;
|
goto suspend;
|
||||||
|
|
||||||
|
@ -206,7 +209,6 @@ static int sof_suspend(struct device *dev, bool runtime_suspend)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
target_state = snd_sof_dsp_power_target(sdev);
|
|
||||||
pm_state.event = target_state;
|
pm_state.event = target_state;
|
||||||
|
|
||||||
/* Skip to platform-specific suspend if DSP is entering D0 */
|
/* Skip to platform-specific suspend if DSP is entering D0 */
|
||||||
|
@ -217,9 +219,6 @@ static int sof_suspend(struct device *dev, bool runtime_suspend)
|
||||||
goto suspend;
|
goto suspend;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tplg_ops->tear_down_all_pipelines)
|
|
||||||
tplg_ops->tear_down_all_pipelines(sdev, false);
|
|
||||||
|
|
||||||
/* suspend DMA trace */
|
/* suspend DMA trace */
|
||||||
sof_fw_trace_suspend(sdev, pm_state);
|
sof_fw_trace_suspend(sdev, pm_state);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue