Skip to content

Conversation

@tmleman
Copy link
Contributor

@tmleman tmleman commented Sep 30, 2025

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")

Copilot AI review requested due to automatic review settings September 30, 2025 12:07
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +736 to +738
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,
Copy link

Copilot AI Sep 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@tmleman
Copy link
Contributor Author

tmleman commented Sep 30, 2025

Original commit is reverted so no need to fix it: #10271

@tmleman tmleman closed this Sep 30, 2025
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant