Skip to content

Commit

Permalink
Fix dspqueue_write_noblock race
Browse files Browse the repository at this point in the history
Currenly check for wait_count is happening before updating
the packet counters due to optimizations. This will result
in HLOS not sending signal properly. This fix will ensure
that wait_count is only checked after updating the packet
counters.

Signed-off-by: ANANDU KRISHNAN E <[email protected]>
  • Loading branch information
quic-anane authored and quic-bkumar committed Nov 22, 2024
1 parent 05dbe07 commit 3fbe5e3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/dspqueue/dspqueue_cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1532,6 +1532,7 @@ AEEResult dspqueue_write_noblock(dspqueue_t queue, uint32_t flags,
cache_flush_word(&dq->state->req_packet_count[q->id]);
if (q->have_wait_counts) {
// Only send a signal if the other end is potentially waiting
barrier_full();
cache_invalidate_word(&read_state->wait_count);
if (read_state->wait_count) {
FARF(MEDIUM, "%s: Send signal", __func__);
Expand Down

0 comments on commit 3fbe5e3

Please sign in to comment.