-
Notifications
You must be signed in to change notification settings - Fork 7.7k
rtio: More useful callback OPs #93227
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good with the API. This is closer to what @bjarki-andreasen mentioned. Just left a question on which parameter to make const.
WRT the error linked to the callback: if we're getting the last-error, we may not get the root-cause errno: chained OPs end up ECANCELED if previous SQEs in the chain report an error; I'd suggest we consider ignoring those subsequent errors if possible.
include/zephyr/rtio/rtio.h
Outdated
@@ -693,7 +713,7 @@ static inline void rtio_sqe_prep_tiny_write(struct rtio_sqe *sqe, | |||
*/ | |||
static inline void rtio_sqe_prep_callback(struct rtio_sqe *sqe, | |||
rtio_callback_t callback, | |||
void *arg0, | |||
const void *arg0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you guys prefer arg0
vs userdata
to be const? Not any preference but I was initially thinking the latter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No preference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
honestly userdata being const in the sqe's makes good sense maybe more so, its meant to be an identifier/attached data thing that rtio stuff doesn't touch anyways, making it const probably makes more sense than making arg0 const
Callbacks now take a result parameter which may, if the callback was linkd to by a previous submissions, have the result code from the last submission. Additionally the userdata is now const by default making it easier to use the device pointer as the userdata which is very common. Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
|
Callbacks now take a result parameter which may, if the callback was linked to by a previous submissions, have the result code from the last submission.
Additionally the callback op is now two, OP_CALLBACK and OP_CALLBACK_MUT where the primary difference is the arg0 parameter is mutable or immutable signaled by the const keyword.
Fixes #81014
DRAFT until a quick look at the API by folks I know who might be interested and agreement, will fix the rest then (tests, in tree code).