From 413950b3e6896b0d77ffcd45e4646aa23c32ca7d Mon Sep 17 00:00:00 2001 From: Marcin Szkudlinski Date: Wed, 6 Sep 2023 14:57:29 +0200 Subject: [PATCH] sparse: remove notifier cache/uncache conversions as buffer pointer now is not swapping between cached and uncached aliases, there's no need to convert pointers in notifier events Signed-off-by: Marcin Szkudlinski --- src/audio/buffer.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/audio/buffer.c b/src/audio/buffer.c index 1519671ff4e6..4f5b9c44c731 100644 --- a/src/audio/buffer.c +++ b/src/audio/buffer.c @@ -205,18 +205,6 @@ void buffer_free(struct comp_buffer *buffer) coherent_free_thread(buffer, c); } -/* - * comp_update_buffer_produce() and comp_update_buffer_consume() send - * NOTIFIER_ID_BUFFER_PRODUCE and NOTIFIER_ID_BUFFER_CONSUME notifier events - * respectively. The only recipient of those notifications is probes. The - * target for those notifications is always the current core, therefore notifier - * callbacks will be called synchronously from notifier_event() calls. Therefore - * we cannot pass unlocked buffer pointers to probes, because if they try to - * acquire the buffer, that can cause a deadlock. In general locked objects - * shouldn't be passed to potentially asynchronous contexts, but here we have no - * choice but to use our knowledge of the local notifier behaviour and pass - * locked buffers to notification recipients. - */ void comp_update_buffer_produce(struct comp_buffer *buffer, uint32_t bytes) { struct buffer_cb_transact cb_data = { @@ -239,8 +227,7 @@ void comp_update_buffer_produce(struct comp_buffer *buffer, uint32_t bytes) audio_stream_produce(&buffer->stream, bytes); - /* Notifier looks for the pointer value to match it against registration */ - notifier_event(cache_to_uncache(buffer), NOTIFIER_ID_BUFFER_PRODUCE, + notifier_event(buffer, NOTIFIER_ID_BUFFER_PRODUCE, NOTIFIER_TARGET_CORE_LOCAL, &cb_data, sizeof(cb_data)); #if CONFIG_SOF_LOG_DBG_BUFFER @@ -280,7 +267,7 @@ void comp_update_buffer_consume(struct comp_buffer *buffer, uint32_t bytes) audio_stream_consume(&buffer->stream, bytes); - notifier_event(cache_to_uncache(buffer), NOTIFIER_ID_BUFFER_CONSUME, + notifier_event(buffer, NOTIFIER_ID_BUFFER_CONSUME, NOTIFIER_TARGET_CORE_LOCAL, &cb_data, sizeof(cb_data)); #if CONFIG_SOF_LOG_DBG_BUFFER