@@ -19,7 +19,7 @@ struct cpu_mutex {
1919} __aligned (CONFIG_DCACHE_LINE_SIZE );
2020
2121/* CPU specific mutexes for each circular buffer */
22- static struct cpu_mutex cpu_mutex [CONFIG_MP_MAX_NUM_CPUS ];
22+ static struct cpu_mutex cpu_mutex [CONFIG_SOF_DEBUG_STREAM_SLOT_FORCE_MAX_CPUS ];
2323
2424#ifdef CONFIG_INTEL_ADSP_DEBUG_SLOT_MANAGER
2525static struct debug_stream_slot_hdr * dbg_stream_slot ;
@@ -54,6 +54,12 @@ debug_stream_get_circular_buffer(struct debug_stream_section_descriptor *desc, u
5454 return NULL ;
5555 }
5656
57+ if (core >= CONFIG_SOF_DEBUG_STREAM_SLOT_FORCE_MAX_CPUS ) {
58+ LOG_DBG ("No section for cpu %u >= %u " , core ,
59+ CONFIG_SOF_DEBUG_STREAM_SLOT_FORCE_MAX_CPUS );
60+ return NULL ;
61+ }
62+
5763 * desc = hdr -> section_desc [core ];
5864 LOG_DBG ("Section %u (desc %u %u %u)" , core , desc -> core_id , desc -> buf_words , desc -> offset );
5965
@@ -116,18 +122,19 @@ int debug_stream_slot_send_record(struct debug_stream_record *rec)
116122static int debug_stream_slot_init (void )
117123{
118124 struct debug_stream_slot_hdr * hdr = debug_stream_get_slot ();
119- size_t hdr_size = ALIGN_UP (offsetof(struct debug_stream_slot_hdr ,
120- section_desc [CONFIG_MP_MAX_NUM_CPUS ]),
121- CONFIG_DCACHE_LINE_SIZE );
125+ size_t hdr_size = ALIGN_UP (
126+ offsetof(struct debug_stream_slot_hdr ,
127+ section_desc [CONFIG_SOF_DEBUG_STREAM_SLOT_FORCE_MAX_CPUS ]),
128+ CONFIG_DCACHE_LINE_SIZE );
122129 size_t section_area_size = ADSP_DW_SLOT_SIZE - hdr_size ;
123130 size_t section_size = ALIGN_DOWN (section_area_size /
124- CONFIG_MP_MAX_NUM_CPUS ,
131+ CONFIG_SOF_DEBUG_STREAM_SLOT_FORCE_MAX_CPUS ,
125132 CONFIG_DCACHE_LINE_SIZE );
126133 size_t offset = hdr_size ;
127134 int i ;
128135
129136 LOG_INF ("%u sections of %u bytes, hdr %u, section area %u" ,
130- CONFIG_MP_MAX_NUM_CPUS , section_size , hdr_size ,
137+ CONFIG_SOF_DEBUG_STREAM_SLOT_FORCE_MAX_CPUS , section_size , hdr_size ,
131138 section_area_size );
132139
133140#ifdef CONFIG_INTEL_ADSP_DEBUG_SLOT_MANAGER
@@ -142,9 +149,9 @@ static int debug_stream_slot_init(void)
142149
143150 hdr -> hdr .magic = DEBUG_STREAM_IDENTIFIER ;
144151 hdr -> hdr .hdr_size = hdr_size ;
145- hdr -> total_size = hdr_size + CONFIG_MP_MAX_NUM_CPUS * section_size ;
146- hdr -> num_sections = CONFIG_MP_MAX_NUM_CPUS ;
147- for (i = 0 ; i < CONFIG_MP_MAX_NUM_CPUS ; i ++ ) {
152+ hdr -> total_size = hdr_size + CONFIG_SOF_DEBUG_STREAM_SLOT_FORCE_MAX_CPUS * section_size ;
153+ hdr -> num_sections = CONFIG_SOF_DEBUG_STREAM_SLOT_FORCE_MAX_CPUS ;
154+ for (i = 0 ; i < CONFIG_SOF_DEBUG_STREAM_SLOT_FORCE_MAX_CPUS ; i ++ ) {
148155 hdr -> section_desc [i ].core_id = i ;
149156 hdr -> section_desc [i ].buf_words =
150157 (section_size - offsetof(struct debug_stream_circular_buf , data [0 ]))/
@@ -154,7 +161,7 @@ static int debug_stream_slot_init(void)
154161 i , section_size , offset );
155162 offset += section_size ;
156163 }
157- for (i = 0 ; i < CONFIG_MP_MAX_NUM_CPUS ; i ++ ) {
164+ for (i = 0 ; i < CONFIG_SOF_DEBUG_STREAM_SLOT_FORCE_MAX_CPUS ; i ++ ) {
158165 struct debug_stream_section_descriptor desc = { 0 };
159166 struct debug_stream_circular_buf * buf =
160167 debug_stream_get_circular_buffer (& desc , i );
0 commit comments