Skip to content

Commit 5820dfa

Browse files
mem: workaround - remove MEM_REG_ATTR_SHARED_HEAP from SOF
This PR does 2 things: - removes MEM_REG_ATTR_SHARED_HEAP to allow merging changes to zephyr - forces buffers location in the very first memory region. This is required because of conflict of virtual addresses with loadable modules in case the platform has 5 cores Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
1 parent 3e4736f commit 5820dfa

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

zephyr/lib/regions_mm.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,7 @@ struct vmh_heap {
4949
*/
5050
struct vmh_heap *vmh_init_heap(const struct vmh_heap_config *cfg, bool allocating_continuously)
5151
{
52-
const struct sys_mm_drv_region *virtual_memory_regions =
53-
sys_mm_drv_query_memory_regions();
5452
int i;
55-
5653
struct vmh_heap *new_heap =
5754
rzalloc(SOF_MEM_FLAG_KERNEL | SOF_MEM_FLAG_COHERENT, sizeof(*new_heap));
5855

@@ -61,14 +58,13 @@ struct vmh_heap *vmh_init_heap(const struct vmh_heap_config *cfg, bool allocatin
6158

6259
k_mutex_init(&new_heap->lock);
6360
struct vmh_heap_config new_config = {0};
64-
const struct sys_mm_drv_region *region;
6561

66-
SYS_MM_DRV_MEMORY_REGION_FOREACH(virtual_memory_regions, region) {
67-
if (region->attr == MEM_REG_ATTR_SHARED_HEAP) {
68-
new_heap->virtual_region = region;
69-
break;
70-
}
71-
}
62+
/* Workaround - use the very first virtual memory region because of virt addresses
63+
* collision.
64+
* Fix will be provided ASAP, but removing MEM_REG_ATTR_SHARED_HEAP from SOF is required
65+
* to merge Zephyr changes
66+
*/
67+
new_heap->virtual_region = sys_mm_drv_query_memory_regions();
7268
if (!new_heap->virtual_region)
7369
goto fail;
7470

0 commit comments

Comments
 (0)