We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug
The internal counter used to keep track of completion queue accounts is only ever incremented, never decreasing.
zephyr/include/zephyr/rtio/rtio.h
Line 1180 in 3d6dde4
This counter is used by rtio_submit to determine when the submission has completed:
rtio_submit
Line 1453 in 3d6dde4
Lines 1473 to 1476 in 3d6dde4
A typical RTIO I2C transaction might like the following:
rtio_sqe_prep_tiny_write
rtio_sqe_prep_read
So 2 CQE events per I2C transaction. If there were 50 I2C transactions per second, this counter would overflow in ~250 days (2**31 / 50 / 2 / 86400).
Increasing or decreasing the I2C transaction rate would scale the overflow duration linearly. At overflow, the second check will pass immediately:
cq_count = INT32_MAX + 1; // INT32_MIN while(INT32_MAX < INT32_MIN) { // Never enters }
Expected behavior
Internal counter overflow should either be detected and handled, or reset in some way through atomic_dec.
atomic_dec
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered:
We need the counter to know when to return, so detecting the rollover is expected and should already work. Agreed a test should show this working
Sorry, something went wrong.
teburd
No branches or pull requests
Describe the bug
The internal counter used to keep track of completion queue accounts is only ever incremented, never decreasing.
zephyr/include/zephyr/rtio/rtio.h
Line 1180 in 3d6dde4
This counter is used by
rtio_submit
to determine when the submission has completed:zephyr/include/zephyr/rtio/rtio.h
Line 1453 in 3d6dde4
zephyr/include/zephyr/rtio/rtio.h
Lines 1473 to 1476 in 3d6dde4
A typical RTIO I2C transaction might like the following:
rtio_sqe_prep_tiny_write
rtio_sqe_prep_read
So 2 CQE events per I2C transaction. If there were 50 I2C transactions per second, this counter would overflow in ~250 days (2**31 / 50 / 2 / 86400).
Increasing or decreasing the I2C transaction rate would scale the overflow duration linearly.
At overflow, the second check will pass immediately:
Expected behavior
Internal counter overflow should either be detected and handled, or reset in some way through
atomic_dec
.Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: