ASoC: SOF: Intel: mtl: Enable multicore support
Subsystems (3)
Peter Ujfalusi
maintainercover ASoC: SOF: Intel: mtl: Enable multicore support
Hi,
The following series will enable multicore support on MTL platforms similarly to other Intel platforms.
The TGL patch is included to simplify the core_put implementation.
Multicore support can be enabled by updated topologies, with current set of tplg files this series is not introducing any runtime change.
Regards,
Peter
---
Rander Wang (3):
ASoC: SOF: Intel: mtl: setup primary core info on MeteorLake platform
ASoC: SOF: Intel: mtl: add core_get & put support on MeterLake
platforms
ASoC: SOF: Intel: tgl: unify core_put on IPC3 & IPC4 path
sound/soc/sof/intel/mtl.c | 52 +++++++++++++++++++++++++++++++++++---- sound/soc/sof/intel/tgl.c | 10 +++++--- 2 files changed, 54 insertions(+), 8 deletions(-)
Signature · 1 line
2.40.1
Peter Ujfalusi
maintainerPATCH 1/3 ASoC: SOF: Intel: mtl: setup primary core info on MeteorLake platform
From: Rander Wang <[email protected]>
Set primary core mask and refcount.
--- sound/soc/sof/intel/mtl.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-)
sound/soc/sof/intel/mtl.c +15 -4
@@ -361,11 +361,17 @@ static int mtl_dsp_core_power_up(struct snd_sof_dev *sdev, int core) ret =snd_sof_dsp_read_poll_timeout (sdev,HDA_DSP_BAR ,MTL_DSP2CXCTL_PRIMARY_CORE , dspcxctl, (dspcxctl & cpa) == cpa,HDA_DSP_REG_POLL_INTERVAL_US ,HDA_DSP_RESET_TIMEOUT_US ); -if (ret <0 ) +if (ret <0 ) {dev_err (sdev->dev,"%s: timeout on MTL_DSP2CXCTL_PRIMARY_CORE read\n" , __func__); +return ret; + } -return ret; +/* set primary core mask and refcount to 1 */ + sdev->enabled_cores_mask =BIT (SOF_DSP_PRIMARY_CORE ); + sdev->dsp_core_ref_count[SOF_DSP_PRIMARY_CORE ] =1 ; + +return 0 ; }static int mtl_dsp_core_power_down (struct snd_sof_dev *sdev,int core)
@@ -388,10 +394,15 @@ static int mtl_dsp_core_power_down(struct snd_sof_dev *sdev, int core) !(dspcxctl &MTL_DSP2CXCTL_PRIMARY_CORE_CPA_MASK ),HDA_DSP_REG_POLL_INTERVAL_US , HDA_DSP_PD_TIMEOUT * USEC_PER_MSEC); -if (ret <0 ) +if (ret <0 ) {dev_err (sdev->dev,"failed to power down primary core\n" ); +return ret; + } -return ret; + sdev->enabled_cores_mask =0 ; + sdev->dsp_core_ref_count[SOF_DSP_PRIMARY_CORE ] =0 ; + +return 0 ; }static int mtl_power_down_dsp (struct snd_sof_dev *sdev)
Signature · 1 line
2.40.1
Peter Ujfalusi
maintainerPATCH 2/3 ASoC: SOF: Intel: mtl: add core_get & put support on MeterLake platforms
In reply to Peter UjfalusiFrom: Rander Wang <[email protected]>
In core_get case, driver can power up primary core and don't need to send ipc message to fw. Non-primary core should be powered up by fw with ipc message.
In core_put case, driver should first send ipc message to fw to disable dsp core then power down primary core if the target is primary core.
--- sound/soc/sof/intel/mtl.c | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-)
sound/soc/sof/intel/mtl.c +32 -1
@@ -624,6 +624,36 @@ static u64 mtl_dsp_get_stream_hda_link_position(struct snd_sof_dev *sdev,return ((u64 )llp_u <<32 ) | llp_l; } +static int mtl_dsp_core_get (struct snd_sof_dev *sdev,int core) +{ +const struct sof_ipc_pm_ops *pm_ops = sdev->ipc->ops->pm; + +if (core ==SOF_DSP_PRIMARY_CORE ) +return mtl_dsp_core_power_up (sdev,SOF_DSP_PRIMARY_CORE ); + +if (pm_ops->set_core_state) +return pm_ops->set_core_state (sdev, core, true); + +return 0 ; +} + +static int mtl_dsp_core_put (struct snd_sof_dev *sdev,int core) +{ +const struct sof_ipc_pm_ops *pm_ops = sdev->ipc->ops->pm; +int ret; + +if (pm_ops->set_core_state) { + ret = pm_ops->set_core_state (sdev, core, false); +if (ret <0 ) +return ret; + } + +if (core ==SOF_DSP_PRIMARY_CORE ) +return mtl_dsp_core_power_down (sdev,SOF_DSP_PRIMARY_CORE ); + +return 0 ; +} +/* Meteorlake ops */ struct snd_sof_dsp_ops sof_mtl_ops;EXPORT_SYMBOL_NS (sof_mtl_ops,SND_SOC_SOF_INTEL_HDA_COMMON );
@@ -660,7 +690,8 @@ int sof_mtl_ops_init(struct snd_sof_dev *sdev) sof_mtl_ops.parse_platform_ext_manifest =NULL ;/* dsp core get/put */ -/* TODO: add core_get and core_put */ + sof_mtl_ops.core_get = mtl_dsp_core_get; + sof_mtl_ops.core_put = mtl_dsp_core_put; sof_mtl_ops.get_stream_position = mtl_dsp_get_stream_hda_link_position;
Signature · 1 line
2.40.1
Peter Ujfalusi
maintainerPATCH 3/3 ASoC: SOF: Intel: tgl: unify core_put on IPC3 & IPC4 path
In reply to Peter UjfalusiFrom: Rander Wang <[email protected]>
Firmware may do context saving before powering off primary core, so driver needs to send ipc msg by set_core_state. In IPC4 path, firmware needs to save current context to IMR before powering off primary core. Firmware does nothing for set_core_state message in IPC3 path. So IPC4 and IPC3 can share the same operation sequence.
--- sound/soc/sof/intel/tgl.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
sound/soc/sof/intel/tgl.c +7 -3
@@ -39,14 +39,18 @@ static int tgl_dsp_core_get(struct snd_sof_dev *sdev, int core)static int tgl_dsp_core_put (struct snd_sof_dev *sdev,int core) {const struct sof_ipc_pm_ops *pm_ops = sdev->ipc->ops->pm; +int ret; + +if (pm_ops->set_core_state) { + ret = pm_ops->set_core_state (sdev, core, false); +if (ret <0 ) +return ret; + }/* power down primary core and return */ if (core ==SOF_DSP_PRIMARY_CORE )return hda_dsp_core_reset_power_down (sdev,BIT (core)); -if (pm_ops->set_core_state) -return pm_ops->set_core_state (sdev, core, false); -return 0 ; }
Signature · 1 line
2.40.1
Mark Brown
maintainerQuoted 9 lines · Peter Ujfalusi
The following series will enable multicore support on MTL platforms similarly to other Intel platforms.
The TGL patch is included to simplify the
core_putimplementation.Multicore support can be enabled by updated topologies, with current set of tplg files this series is not introducing any runtime change.
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[2/3] ASoC: SOF: Intel: mtl: add core_get & put support on MeterLake platforms
commit: c6d15567a4d5dd51ecccc332d514c6dc21bce652
[3/3] ASoC: SOF: Intel: tgl: unify core_put on IPC3 & IPC4 path
commit: 1b167ba8a20152041d3af0c0cbbfd710f1e93e4bAll 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
Hi Mark,
Quoted 9 lines · Peter Ujfalusi
Quoted 8 lines
The following series will enable multicore support on MTL platforms similarly to other Intel platforms.
The TGL patch is included to simplify the
core_putimplementation.Multicore support can be enabled by updated topologies, with current set of tplg files this series is not introducing any runtime change.
Quoted 7 lines
Quoted 1 line
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
Looks like patch1 was not applied:
[PATCH 1/3] ASoC: SOF: Intel: mtl: setup primary core info on MeteorLake platform
was there anything wrong with it or is this a b4/script issue?
Please let us know if we need to resend it or modify it.
Thanks,
-Pierre
Quoted 24 lines
[2/3] ASoC: SOF: Intel: mtl: add
core_get& put support on MeterLake platformscommit: c6d15567a4d5dd51ecccc332d514c6dc21bce652 [3/3] ASoC: SOF: Intel: tgl: unify core_put on IPC3 & IPC4 path commit: 1b167ba8a20152041d3af0c0cbbfd710f1e93e4bAll 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
Mark Brown
maintainerQuoted 8 lines · Pierre-Louis Bossart
Looks like patch1 was not applied:
[PATCH 1/3] ASoC: SOF: Intel: mtl: setup primary core info on MeteorLake platform
was there anything wrong with it or is this a b4/script issue?
Please let us know if we need to resend it or modify it.
I imagine it ended up looking like it was already applied, please resend.