From 99dfb388901dd845e3a81f134c34d13a168d0ebc Mon Sep 17 00:00:00 2001 From: Keyon Jie Date: Fri, 12 Nov 2021 17:35:58 +0800 Subject: [PATCH] cavs-ipc: fix the IPC_COUNTERS debug for multi-core scenarios In multi-core cases, the IPC could be handled by a secondary DSP core, which means we need to use ipc_processed_counter with coherent access, otherwise, the counter may be calculated wrongly. Signed-off-by: Keyon Jie --- src/drivers/intel/cavs/ipc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/drivers/intel/cavs/ipc.c b/src/drivers/intel/cavs/ipc.c index 277908729..d00c9a24c 100644 --- a/src/drivers/intel/cavs/ipc.c +++ b/src/drivers/intel/cavs/ipc.c @@ -46,9 +46,10 @@ static inline void increment_ipc_received_counter(void) static inline void increment_ipc_processed_counter(void) { static uint32_t ipc_processed_counter; + uint32_t *uncache_counter = cache_to_uncache(&ipc_processed_counter); mailbox_sw_reg_write(SRAM_REG_FW_IPC_PROCESSED_COUNT, - ipc_processed_counter++); + (*uncache_counter)++); } #endif