[Sound-open-firmware] [PATCH] alloc: rmalloc must check other zones/pools for capabilities

Liam Girdwood liam.r.girdwood at linux.intel.com
Tue Mar 6 15:16:04 CET 2018


rmalloc should also check the buffer heap if no capable memory can be
found in the runtime heap.

Signed-off-by: Liam Girdwood <liam.r.girdwood at linux.intel.com>
---
 src/lib/alloc.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/lib/alloc.c b/src/lib/alloc.c
index 6221d26..27916e3 100644
--- a/src/lib/alloc.c
+++ b/src/lib/alloc.c
@@ -351,10 +351,17 @@ static void *rmalloc_runtime(uint32_t caps, size_t bytes)
 	struct mm_heap *heap;
 	int i;
 
+	/* check runtime heap for capabilities */
 	heap = get_runtime_heap_from_caps(caps);
+	if (heap)
+		goto find;
+
+	/* next check buffer heap for capabilities */
+	heap = get_buffer_heap_from_caps(caps);
 	if (heap == NULL)
 		goto error;
 
+find:
 	for (i = 0; i < heap->blocks; i++) {
 
 		/* is block big enough */
-- 
2.14.1



More information about the Sound-open-firmware mailing list