Skip to content

Commit fcf6c8c

Browse files
ktrzcinxlgirdwood
authored andcommitted
trace: Use uncached memory in trace_point and panic
It didn't work correctly if multiple cores write to "sw regs" allocated on the same cache line. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
1 parent b2f0887 commit fcf6c8c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/include/sof/lib/mailbox.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,11 @@ void mailbox_stream_write(size_t offset, const void *src, size_t bytes)
105105
static inline
106106
void mailbox_sw_reg_write(size_t offset, uint32_t src)
107107
{
108-
*((volatile uint32_t*)(MAILBOX_SW_REG_BASE + offset)) = src;
109-
dcache_writeback_region((void *)(MAILBOX_SW_REG_BASE + offset),
110-
sizeof(src));
108+
volatile uint32_t *ptr;
109+
110+
ptr = (volatile uint32_t *)(MAILBOX_SW_REG_BASE + offset);
111+
ptr = cache_to_uncache(ptr);
112+
*ptr = src;
111113
}
112114

113115
#endif /* __SOF_LIB_MAILBOX_H__ */

0 commit comments

Comments
 (0)