diff --git a/soc/intel/intel_adsp/ace/Kconfig b/soc/intel/intel_adsp/ace/Kconfig index cdd2749915d3b..a7e225923aa4e 100644 --- a/soc/intel/intel_adsp/ace/Kconfig +++ b/soc/intel/intel_adsp/ace/Kconfig @@ -53,3 +53,12 @@ config SOC_SERIES_INTEL_ADSP_ACE_NUM_SPIN_RELAX_NOPS help Specify the number of NOPs in Intel Audio DSP specific arch_spin_relax(). + +config SOC_SERIES_INTEL_ADSP_ACE_NUM_SPIN_RELAX_NOPS_ADD_CPU_ID + bool "Add CPU ID to offset NOPs" + depends on SOC_SERIES_INTEL_ADSP_ACE_CUSTOM_MORE_SPIN_RELAX_NOPS + help + Add CPU ID to the number of NOPs in arch_spin_relax(). + This is to add some variations to the loop for each CPU to + further avoid them hitting the RCW transactions at the same + time. diff --git a/soc/intel/intel_adsp/ace/spin_relax.c b/soc/intel/intel_adsp/ace/spin_relax.c index 073deb5a6d07d..0abf94398db1b 100644 --- a/soc/intel/intel_adsp/ace/spin_relax.c +++ b/soc/intel/intel_adsp/ace/spin_relax.c @@ -9,13 +9,20 @@ #include #include +#include + #ifdef CONFIG_SOC_SERIES_INTEL_ADSP_ACE_NUM_SPIN_RELAX_NOPS void arch_spin_relax(void) { register uint32_t remaining = CONFIG_SOC_SERIES_INTEL_ADSP_ACE_NUM_SPIN_RELAX_NOPS; +#if defined(CONFIG_SOC_SERIES_INTEL_ADSP_ACE_NUM_SPIN_RELAX_NOPS_ADD_CPU_ID) + remaining += arch_proc_id(); +#endif /* CONFIG_SOC_SERIES_INTEL_ADSP_ACE_NUM_SPIN_RELAX_NOPS_ADD_CPU_ID */ + while (remaining > 0) { -#if (CONFIG_SOC_SERIES_INTEL_ADSP_ACE_NUM_SPIN_RELAX_NOPS % 4) == 0 +#if !defined(CONFIG_SOC_SERIES_INTEL_ADSP_ACE_NUM_SPIN_RELAX_NOPS_ADD_CPU_ID) && \ + (CONFIG_SOC_SERIES_INTEL_ADSP_ACE_NUM_SPIN_RELAX_NOPS % 4) == 0 remaining -= 4; /* diff --git a/tests/kernel/smp/boards/intel_adsp_ace15_mtpm.conf b/tests/kernel/smp/boards/intel_adsp_ace15_mtpm.conf new file mode 100644 index 0000000000000..3db4d23770ee0 --- /dev/null +++ b/tests/kernel/smp/boards/intel_adsp_ace15_mtpm.conf @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_SOC_SERIES_INTEL_ADSP_ACE_NUM_SPIN_RELAX_NOPS_ADD_CPU_ID=y diff --git a/tests/kernel/smp/boards/intel_adsp_ace20_lnl.conf b/tests/kernel/smp/boards/intel_adsp_ace20_lnl.conf new file mode 100644 index 0000000000000..3db4d23770ee0 --- /dev/null +++ b/tests/kernel/smp/boards/intel_adsp_ace20_lnl.conf @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_SOC_SERIES_INTEL_ADSP_ACE_NUM_SPIN_RELAX_NOPS_ADD_CPU_ID=y diff --git a/tests/kernel/smp/boards/intel_adsp_ace30_ptl.conf b/tests/kernel/smp/boards/intel_adsp_ace30_ptl.conf new file mode 100644 index 0000000000000..3db4d23770ee0 --- /dev/null +++ b/tests/kernel/smp/boards/intel_adsp_ace30_ptl.conf @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_SOC_SERIES_INTEL_ADSP_ACE_NUM_SPIN_RELAX_NOPS_ADD_CPU_ID=y diff --git a/tests/kernel/smp/boards/intel_adsp_ace40_nvl.conf b/tests/kernel/smp/boards/intel_adsp_ace40_nvl.conf new file mode 100644 index 0000000000000..3db4d23770ee0 --- /dev/null +++ b/tests/kernel/smp/boards/intel_adsp_ace40_nvl.conf @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_SOC_SERIES_INTEL_ADSP_ACE_NUM_SPIN_RELAX_NOPS_ADD_CPU_ID=y