Skip to content

Commit c9ee307

Browse files
author
Jyri Sarha
committed
ipc4: helper: Do not invalidate cache of whole mailbox for module init
Invalidate cache for only the module init payload size not the whole mailbox. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
1 parent ea3b7a3 commit c9ee307

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

src/ipc/ipc4/helper.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,19 @@ __cold struct comp_dev *comp_new_ipc4(struct ipc4_module_init_instance *module_i
139139
ipc_config.core = module_init->extension.r.core_id;
140140
ipc_config.ipc_config_size = module_init->extension.r.param_block_size * sizeof(uint32_t);
141141
ipc_config.ipc_extended_init = module_init->extension.r.extended_init;
142-
143-
dcache_invalidate_region((__sparse_force void __sparse_cache *)MAILBOX_HOSTBOX_BASE,
144-
MAILBOX_HOSTBOX_SIZE);
145-
142+
if (ipc_config.ipc_config_size > MAILBOX_HOSTBOX_SIZE) {
143+
tr_err(&ipc_tr, "IPC payload size %u too big for the message window",
144+
ipc_config.ipc_config_size);
145+
return NULL;
146+
}
147+
#ifdef CONFIG_DCACHE_LINE_SIZE
148+
if (!IS_ENABLED(CONFIG_LIBRARY))
149+
sys_cache_data_invd_range((__sparse_force void __sparse_cache *)
150+
MAILBOX_HOSTBOX_BASE,
151+
ALIGN_UP(ipc_config.ipc_config_size,
152+
CONFIG_DCACHE_LINE_SIZE));
153+
#endif
146154
data = ipc4_get_comp_new_data();
147-
148155
#if CONFIG_LIBRARY
149156
ipc_config.ipc_config_size -= sizeof(struct sof_uuid);
150157
drv = ipc4_library_get_comp_drv(data + ipc_config.ipc_config_size);

0 commit comments

Comments
 (0)