Skip to content

Commit 720bd70

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 720bd70

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/ipc/ipc4/helper.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,15 @@ __cold struct comp_dev *comp_new_ipc4(struct ipc4_module_init_instance *module_i
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;
142142

143-
dcache_invalidate_region((__sparse_force void __sparse_cache *)MAILBOX_HOSTBOX_BASE,
144-
MAILBOX_HOSTBOX_SIZE);
145-
143+
#ifdef CONFIG_DCACHE_LINE_SIZE
144+
if (!IS_ENABLED(CONFIG_LIBRARY))
145+
sys_cache_data_invd_range((__sparse_force void __sparse_cache *)
146+
MAILBOX_HOSTBOX_BASE,
147+
MIN(ALIGN_UP(ipc_config.ipc_config_size,
148+
CONFIG_DCACHE_LINE_SIZE),
149+
MAILBOX_HOSTBOX_SIZE));
150+
#endif
146151
data = ipc4_get_comp_new_data();
147-
148152
#if CONFIG_LIBRARY
149153
ipc_config.ipc_config_size -= sizeof(struct sof_uuid);
150154
drv = ipc4_library_get_comp_drv(data + ipc_config.ipc_config_size);

0 commit comments

Comments
 (0)