Skip to content

RTIO: fix CQE semaphore bypass when no CQE item was created #93544

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions include/zephyr/rtio/rtio.h
Original file line number Diff line number Diff line change
Expand Up @@ -1309,6 +1309,9 @@ static inline void rtio_cqe_submit(struct rtio *r, int result, void *userdata, u
cqe->userdata = userdata;
cqe->flags = flags;
rtio_cqe_produce(r, cqe);
#ifdef CONFIG_RTIO_CONSUME_SEM
k_sem_give(r->consume_sem);
#endif
}

/* atomic_t isn't guaranteed to wrap correctly as it could be signed, so
Expand All @@ -1329,9 +1332,6 @@ static inline void rtio_cqe_submit(struct rtio *r, int result, void *userdata, u
}
}
#endif
#ifdef CONFIG_RTIO_CONSUME_SEM
k_sem_give(r->consume_sem);
#endif
}

#define __RTIO_MEMPOOL_GET_NUM_BLKS(num_bytes, blk_size) (((num_bytes) + (blk_size)-1) / (blk_size))
Expand Down