Skip to content

Commit 5b6625b

Browse files
bug: missed fixes when CONFIG_INCOHERENT=0
cache operations are pointless when architecture is coherent Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
1 parent 6c29ad3 commit 5b6625b

1 file changed

Lines changed: 3 additions & 15 deletions

File tree

src/include/sof/coherent.h

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -385,29 +385,17 @@ static inline void __coherent_shared(struct coherent *c, const size_t size)
385385
__must_check static inline struct coherent __sparse_cache *coherent_acquire_thread(
386386
struct coherent *c, const size_t size)
387387
{
388-
if (c->shared) {
389-
struct coherent __sparse_cache *cc = uncache_to_cache(c);
390-
388+
if (c->shared)
391389
k_mutex_lock(&c->mutex, K_FOREVER);
392390

393-
/* invalidate local copy */
394-
dcache_invalidate_region(cc, size);
395-
}
396-
397391
return (__sparse_force struct coherent __sparse_cache *)c;
398392
}
399393

400394
static inline void coherent_release_thread(struct coherent __sparse_cache *c,
401395
const size_t size)
402396
{
403-
if (c->shared) {
404-
struct coherent *uc = cache_to_uncache(c);
405-
406-
/* wtb and inv local data to coherent object */
407-
dcache_writeback_invalidate_region(c, size);
408-
409-
k_mutex_unlock(&uc->mutex);
410-
}
397+
if (c->shared)
398+
k_mutex_unlock(&c->mutex);
411399
}
412400

413401
static inline void *__coherent_init_thread(size_t offset, const size_t size)

0 commit comments

Comments
 (0)