From f6530599801e0953fd43a23937bae0b5cc0e3747 Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Wed, 17 Jan 2024 23:08:23 +0200 Subject: [PATCH] idc: zephyr: remove unnecessary cache invd/flush calls The IDC message objects are stored to static "idc_work", so the cache operations are unnecessary when pointers to these messages are passed around. Signed-off-by: Kai Vehmanen --- src/idc/zephyr_idc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/idc/zephyr_idc.c b/src/idc/zephyr_idc.c index d165ef9f19b2..22db8636c401 100644 --- a/src/idc/zephyr_idc.c +++ b/src/idc/zephyr_idc.c @@ -73,8 +73,7 @@ static void idc_handler(struct k_p4wq_work *work) int payload = -1; k_spinlock_key_t key; - /* A message is received from another core, invalidate local cache */ - sys_cache_data_invd_range(msg, sizeof(*msg)); + __ASSERT_NO_MSG(!is_cached(msg)); if (msg->size == sizeof(int)) { const int idc_handler_memcpy_err __unused = @@ -145,8 +144,8 @@ int idc_send_msg(struct idc_msg *msg, uint32_t mode) /* Temporarily store sender core ID */ msg_cp->core = cpu_get_id(); - /* Sending a message to another core, write back local message cache */ - sys_cache_data_flush_range(msg_cp, sizeof(*msg_cp)); + __ASSERT_NO_MSG(!is_cached(msg_cp)); + k_p4wq_submit(q_zephyr_idc + target_cpu, work); switch (mode) {