audio: fix cache invalidation in audio_stream_invalidate#10272
audio: fix cache invalidation in audio_stream_invalidate#10272tmleman wants to merge 1 commit intothesofproject:mainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes build failures caused by incomplete API migration in the audio_stream_invalidate() function. Two calls to the deprecated dcache_invalidate_region() API were missed during the cache API refactor and are now updated to use the new Zephyr cache API.
- Replace remaining dcache_invalidate_region() calls with sys_cache_data_flush_range()
- Complete the cache API migration that was previously started in commit f78acf4
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| sys_cache_data_flush_range((__sparse_force void __sparse_cache *)buffer->r_ptr, head_size); | ||
| if (tail_size) | ||
| dcache_invalidate_region((__sparse_force void __sparse_cache *)buffer->addr, | ||
| tail_size); | ||
| sys_cache_data_flush_range((__sparse_force void __sparse_cache *)buffer->addr, |
There was a problem hiding this comment.
The function name is audio_stream_invalidate() but the implementation uses sys_cache_data_flush_range() instead of sys_cache_data_invd_range(). For cache invalidation, you should use sys_cache_data_invd_range() which invalidates cache lines without writing back dirty data, whereas flush_range() writes back and then invalidates.
|
Original commit is reverted so no need to fix it: #10271 |
Fix remaining calls to old dcache_invalidate_region() API in the audio_stream_invalidate() function that were missed during the cache API migration. Replace with proper sys_cache_data_invd_range() calls. The previous refactor left two calls to the old API which causes build failures. Fixes: f78acf4 ("audio: use zephyr/cache.h for cache flush/invalidate") Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
Fix remaining calls to old dcache_invalidate_region() API in the audio_stream_invalidate() function that were missed during the cache API migration. Replace with proper sys_cache_data_invd_range() calls.
The previous refactor left two calls to the old API which causes build failures.
Fixes: f78acf4 ("audio: use zephyr/cache.h for cache flush/invalidate")