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

Conversation

ubieda
Copy link
Member

@ubieda ubieda commented Jul 23, 2025

Otherwise, calls to rtio_cqe_consume_block will bypass the semaphore and held back in a Z_SPIN_DELAY(1) indefinitely.

Reference:

#ifdef CONFIG_RTIO_CONSUME_SEM
k_sem_take(r->consume_sem, K_FOREVER);
#endif
node = mpsc_pop(&r->cq);
while (node == NULL) {
Z_SPIN_DELAY(1);
node = mpsc_pop(&r->cq);
}

Otherwise, calls to rtio_cqe_consume_block will bypass the semaphore
and held back in a Z_SPIN_DELAY(1) indefinitely.

Signed-off-by: Luis Ubieda <[email protected]>
@ubieda ubieda added the bug The issue is a bug, or the PR is fixing a bug label Jul 23, 2025
@ubieda ubieda changed the title rtio: fix CQE semaphore by not giving it no CQE item was created RTIO: fix CQE semaphore bypass when no CQE item was created Jul 23, 2025
Copy link

@ubieda ubieda marked this pull request as ready for review July 23, 2025 01:23
@zephyrbot zephyrbot requested review from teburd and yperess July 23, 2025 01:24
@ubieda ubieda requested a review from bjarki-andreasen July 23, 2025 06:33
@cfriedt cfriedt merged commit 1187e17 into zephyrproject-rtos:main Jul 25, 2025
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: RTIO bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants