-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
i2c: Bug fixes for default RTIO handler #79890
Conversation
036211e
to
940f2ba
Compare
Not sure why this PR didn't get review-requests. |
TXRX is meant specifically to handle a full duplex bus like SPI, I2C is half duplex meaning only read or write can be performed at once. Drop TXRX as a supported operation code for the default I2C submission path. Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
30417c4
to
eff46a7
Compare
looks like some tests may need to be updated... but I ported over this code to my default i3c rtio handler branch that I'm working on and it's looking as expected with 'restarts' in between transactions. Thanks for this!! |
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.
Code looks good! Approving assuming we take care of https://github.com/zephyrproject-rtos/zephyr/tree/main/tests/subsys/rtio/rtio_i2c.
db32ac8
to
5c8217d
Compare
77186ea
to
d84d383
Compare
Transactions from RTIO should result in single calls to i2c_transfer. This corrects the default handler to first count the number of submissions in the transaction, allocate on the stack, and then copy over each submission to an equivalent i2c_msg. It also cleans up the helper functions to be infallible, taking only the submission and msg to copy to. Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
d84d383
to
fafa353
Compare
Transactions should result in a single transfer call not multiple transfer calls. Transceive isn't supported by i2c and so the TXRX op isn't validated for success anymore. Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
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.
Nice!
TXRX is meant specifically to handle a full duplex bus like SPI, I2C is half duplex meaning only read or write can be performed at once. Drop TXRX from the default handler.
Each transaction should result in a single call to i2c_transfer. This corrects the default handler to do just that. Also simplifies the various helpers here.