From ae238d5623089cc172237cafaac77250d2e538c0 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Wed, 21 Dec 2022 16:32:51 +0100 Subject: [PATCH 1/2] module-adapter: fix address space mismatch Fix address space mismatch, caused by 133eecb1323d ("module_adapter: Add APIs for coherent module source info access"). Signed-off-by: Guennadi Liakhovetski --- src/include/sof/audio/module_adapter/module/generic.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/include/sof/audio/module_adapter/module/generic.h b/src/include/sof/audio/module_adapter/module/generic.h index 37a0e3eaa4e8..5d54deb71a90 100644 --- a/src/include/sof/audio/module_adapter/module/generic.h +++ b/src/include/sof/audio/module_adapter/module/generic.h @@ -249,8 +249,7 @@ static inline void module_update_buffer_position(struct input_stream_buffer *inp } __must_check static inline -struct module_source_info __sparse_cache * -module_source_info_acquire(struct module_source_info __sparse_cache *msi) +struct module_source_info __sparse_cache *module_source_info_acquire(struct module_source_info *msi) { struct coherent __sparse_cache *c; From 9ac90a25eecab65d89acaab8fcb7836e246e8632 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Wed, 21 Dec 2022 16:38:03 +0100 Subject: [PATCH 2/2] mixin-mixout: fix address space mismatch Fix address space conflicts caused by bf7aa048902c ("mixout: Convert component to use the module adapter") Signed-off-by: Guennadi Liakhovetski --- src/audio/mixin_mixout/mixin_mixout.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/audio/mixin_mixout/mixin_mixout.c b/src/audio/mixin_mixout/mixin_mixout.c index ba68ca72e2ca..f9e006abca53 100644 --- a/src/audio/mixin_mixout/mixin_mixout.c +++ b/src/audio/mixin_mixout/mixin_mixout.c @@ -517,14 +517,16 @@ static int mixout_process(struct processing_module *mod, */ for (i = 0; i < num_input_buffers; i++) { const struct audio_stream __sparse_cache *source_stream; - struct comp_buffer *unused_in_between_buf; + struct comp_buffer __sparse_cache *unused_in_between_buf; struct comp_dev *source; int source_index; source_stream = mod->input_buffers[i].data; - unused_in_between_buf = container_of(source_stream, struct comp_buffer, stream); + unused_in_between_buf = attr_container_of(source_stream, + struct comp_buffer __sparse_cache, + stream, __sparse_cache); - source = buffer_get_comp(unused_in_between_buf, PPL_DIR_UPSTREAM); + source = unused_in_between_buf->source; source_index = find_module_source_index(mod_source_info, source); /* this shouldn't happen but skip even if it does and move to the next source */ @@ -538,16 +540,17 @@ static int mixout_process(struct processing_module *mod, if (frames_to_produce > 0 && frames_to_produce < INT32_MAX) { for (i = 0; i < num_input_buffers; i++) { const struct audio_stream __sparse_cache *source_stream; - struct comp_buffer *unused_in_between_buf; + struct comp_buffer __sparse_cache *unused_in_between_buf; struct comp_dev *source; int source_index; uint32_t pending_frames; source_stream = mod->input_buffers[i].data; - unused_in_between_buf = container_of(source_stream, struct comp_buffer, - stream); + unused_in_between_buf = attr_container_of(source_stream, + struct comp_buffer __sparse_cache, + stream, __sparse_cache); - source = buffer_get_comp(unused_in_between_buf, PPL_DIR_UPSTREAM); + source = unused_in_between_buf->source; source_index = find_module_source_index(mod_source_info, source); if (source_index < 0)