Skip to content

Commit d3628fc

Browse files
ubiedafabiobaltieri
authored andcommitted
rtio: multishot: Stop resubmitting multishot items on error
As an error-handling strategy. The client then can recover from this depending on the error and the number of occurrences. Signed-off-by: Luis Ubieda <[email protected]>
1 parent 7b4644c commit d3628fc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

subsys/rtio/rtio_executor.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,12 @@ static inline void rtio_executor_handle_multishot(struct rtio_iodev_sqe *iodev_s
145145
iodev_sqe->sqe.rx.buf_len = 0;
146146
}
147147

148-
if (is_canceled) {
148+
/** We're releasing reasources when erroring as an error handling scheme of multi-shot
149+
* submissions by requiring to stop re-submitting if something goes wrong. Let the
150+
* application decide what's best for handling the corresponding error: whether
151+
* re-submitting, rebooting or anything else.
152+
*/
153+
if (is_canceled || !is_ok) {
149154
LOG_DBG("Releasing memory @%p size=%u", (void *)iodev_sqe->sqe.rx.buf,
150155
iodev_sqe->sqe.rx.buf_len);
151156
rtio_release_buffer(r, iodev_sqe->sqe.rx.buf, iodev_sqe->sqe.rx.buf_len);

0 commit comments

Comments
 (0)