Skip to content

Commit 99ebb76

Browse files
committed
mailbox: use uncached address to write sw regs
mailbox_sw_regs_write is used by dai to update llp node. In multi-core test, the updated llp node is invisable to other cores although dcache_writeback_region is used on both cavs & ace platforms. Now use uncached address to write memory directly which is aligned with other mailbox access functions. Validated on cavs & ace platforms. Signed-off-by: Rander Wang <rander.wang@intel.com>
1 parent e62e333 commit 99ebb76

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/platform/intel/ace/include/ace/lib/mailbox.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ static inline uint64_t mailbox_sw_reg_read64(size_t offset)
8080

8181
static inline void mailbox_sw_regs_write(size_t offset, const void *src, size_t bytes)
8282
{
83-
int regs_write_err __unused = memcpy_s((void *)(MAILBOX_SW_REG_BASE + offset),
84-
MAILBOX_SW_REG_SIZE - offset, src, bytes);
83+
uint32_t __sparse_cache *ptr_c;
84+
uint32_t *ptr;
8585

86-
assert(!regs_write_err);
87-
dcache_writeback_region((__sparse_force void __sparse_cache *)(MAILBOX_SW_REG_BASE +
88-
offset), bytes);
86+
ptr_c = (uint32_t __sparse_cache *)(MAILBOX_SW_REG_BASE + offset);
87+
ptr = cache_to_uncache(ptr_c);
88+
memcpy_s(ptr, MAILBOX_SW_REG_SIZE - offset, src, bytes);
8989
}
9090

9191
#endif /* __ACE_LIB_MAILBOX_H__ */

src/platform/intel/cavs/include/cavs/lib/mailbox.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ static inline uint64_t mailbox_sw_reg_read64(size_t offset)
108108

109109
static inline void mailbox_sw_regs_write(size_t offset, const void *src, size_t bytes)
110110
{
111-
int regs_write_err __unused = memcpy_s((void *)(MAILBOX_SW_REG_BASE + offset),
112-
MAILBOX_SW_REG_SIZE - offset, src, bytes);
111+
uint32_t __sparse_cache *ptr_c;
112+
uint32_t *ptr;
113113

114-
assert(!regs_write_err);
115-
dcache_writeback_region((__sparse_force void __sparse_cache *)(MAILBOX_SW_REG_BASE +
116-
offset), bytes);
114+
ptr_c = (uint32_t __sparse_cache *)(MAILBOX_SW_REG_BASE + offset);
115+
ptr = cache_to_uncache(ptr_c);
116+
memcpy_s(ptr, MAILBOX_SW_REG_SIZE - offset, src, bytes);
117117
}
118118

119119
#endif /* __CAVS_LIB_MAILBOX_H__ */

0 commit comments

Comments
 (0)