@@ -103,7 +103,7 @@ static struct sof_fast_get_entry *fast_get_find_entry(struct sof_fast_get_data *
103103#endif
104104
105105#if CONFIG_USERSPACE
106- static bool fast_get_domain_exists (struct k_thread * thread , void * start , size_t size )
106+ static bool fast_get_partition_exists (struct k_thread * thread , void * start , size_t size )
107107{
108108 struct k_mem_domain * domain = thread -> mem_domain_info .mem_domain ;
109109
@@ -185,12 +185,15 @@ const void *fast_get(struct k_heap *heap, const void *dram_ptr, size_t size)
185185#if CONFIG_USERSPACE
186186 struct k_mem_domain * mdom = k_current_get ()-> mem_domain_info .mem_domain ;
187187
188- /* We only get there for large buffers */
188+ /*
189+ * We only get there for large buffers, since small buffers with
190+ * enabled userspace don't create fast-get entries
191+ */
189192 if (mdom -> num_partitions > 1 ) {
190193 /* A userspace thread makes the request */
191194 if (mdom != entry -> mdom &&
192- !fast_get_domain_exists (k_current_get (), ret ,
193- ALIGN_UP (size , CONFIG_MM_DRV_PAGE_SIZE ))) {
195+ !fast_get_partition_exists (k_current_get (), ret ,
196+ ALIGN_UP (size , CONFIG_MM_DRV_PAGE_SIZE ))) {
194197 LOG_DBG ("grant access to domain %p first was %p" , mdom ,
195198 entry -> mdom );
196199
@@ -284,7 +287,7 @@ void fast_put(struct k_heap *heap, struct k_mem_domain *mdom, const void *sram_p
284287 entry -> refcount -- ;
285288
286289 if (!entry -> refcount ) {
287- LOG_DBG ("freeing buffer %p" , entry -> sram_ptr );
290+ LOG_DBG ("freeing buffer %p" , sram_ptr );
288291 sof_heap_free (heap , entry -> sram_ptr );
289292 }
290293
@@ -299,7 +302,7 @@ void fast_put(struct k_heap *heap, struct k_mem_domain *mdom, const void *sram_p
299302 */
300303 if (entry -> size > FAST_GET_MAX_COPY_SIZE && entry -> mdom && mdom ) {
301304 struct k_mem_partition part = {
302- .start = (uintptr_t )entry -> sram_ptr ,
305+ .start = (uintptr_t )sram_ptr ,
303306 .size = ALIGN_UP (entry -> size , CONFIG_MM_DRV_PAGE_SIZE ),
304307 .attr = K_MEM_PARTITION_P_RO_U_RO | XTENSA_MMU_CACHED_WB ,
305308 };
0 commit comments