Skip to content

Commit

Permalink
trace: Use uncached memory in trace_point and panic
Browse files Browse the repository at this point in the history
 It didn't work correctly if multiple cores write to "sw regs"
 allocated on the same cache line.

Signed-off-by: Karol Trzcinski <[email protected]>
  • Loading branch information
ktrzcinx authored and lgirdwood committed Nov 22, 2019
1 parent b2f0887 commit fcf6c8c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/include/sof/lib/mailbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,11 @@ void mailbox_stream_write(size_t offset, const void *src, size_t bytes)
static inline
void mailbox_sw_reg_write(size_t offset, uint32_t src)
{
*((volatile uint32_t*)(MAILBOX_SW_REG_BASE + offset)) = src;
dcache_writeback_region((void *)(MAILBOX_SW_REG_BASE + offset),
sizeof(src));
volatile uint32_t *ptr;

ptr = (volatile uint32_t *)(MAILBOX_SW_REG_BASE + offset);
ptr = cache_to_uncache(ptr);
*ptr = src;
}

#endif /* __SOF_LIB_MAILBOX_H__ */

0 comments on commit fcf6c8c

Please sign in to comment.