-
Notifications
You must be signed in to change notification settings - Fork 8.2k
i2c: Bug fixes for default RTIO handler #79890
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
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!! |
ubieda
left a comment
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>
bjarki-andreasen
left a comment
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!
This patch fixes transcation op items not performed within a single SPI transfer. This is common for Write + Read commands, that depend on the CS kept asserted until the end, otherwise the context will be lost. A similar fix was applied to i2c_rtio_default on zephyrproject-rtos#79890. Signed-off-by: Luis Ubieda <luisf@croxel.com>
This patch fixes transcation op items not performed within a single SPI transfer. This is common for Write + Read commands, that depend on the CS kept asserted until the end, otherwise the context will be lost. A similar fix was applied to i2c_rtio_default on zephyrproject-rtos#79890. Signed-off-by: Luis Ubieda <luisf@croxel.com>
This patch fixes transaction op items not performed within a single SPI transfer. This is common for Write + Read commands, that depend on the CS kept asserted until the end, otherwise the context will be lost. A similar fix was applied to i2c_rtio_default on zephyrproject-rtos#79890. Signed-off-by: Luis Ubieda <luisf@croxel.com>
This patch fixes transcation op items not performed within a single SPI transfer. This is common for Write + Read commands, that depend on the CS kept asserted until the end, otherwise the context will be lost. A similar fix was applied to i2c_rtio_default on zephyrproject-rtos#79890. Signed-off-by: Luis Ubieda <luisf@croxel.com>
This patch fixes transaction op items not performed within a single SPI transfer. This is common for Write + Read commands, that depend on the CS kept asserted until the end, otherwise the context will be lost. A similar fix was applied to i2c_rtio_default on #79890. Signed-off-by: Luis Ubieda <luisf@croxel.com>
This patch fixes transaction op items not performed within a single SPI transfer. This is common for Write + Read commands, that depend on the CS kept asserted until the end, otherwise the context will be lost. A similar fix was applied to i2c_rtio_default on #79890. Signed-off-by: Luis Ubieda <luisf@croxel.com> (cherry picked from commit b5ca5b7)
This patch fixes transaction op items not performed within a single SPI transfer. This is common for Write + Read commands, that depend on the CS kept asserted until the end, otherwise the context will be lost. A similar fix was applied to i2c_rtio_default on zephyrproject-rtos#79890. (cherry picked from commit b5ca5b7) Original-Signed-off-by: Luis Ubieda <luisf@croxel.com> GitOrigin-RevId: b5ca5b7 Cr-Build-Id: 8722372693993862145 Cr-Build-Url: https://cr-buildbucket.appspot.com/build/8722372693993862145 Copybot-Job-Name: zephyr-main-copybot-downstream Change-Id: I71dff336083476aee898a9e21e51d840b5cdeb72 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/6289904 Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com> Commit-Queue: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com> Bot-Commit: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com>
This patch fixes transaction op items not performed within a single SPI transfer. This is common for Write + Read commands, that depend on the CS kept asserted until the end, otherwise the context will be lost. A similar fix was applied to i2c_rtio_default on zephyrproject-rtos#79890. Signed-off-by: Luis Ubieda <luisf@croxel.com>
This patch fixes transaction op items not performed within a single SPI transfer. This is common for Write + Read commands, that depend on the CS kept asserted until the end, otherwise the context will be lost. A similar fix was applied to i2c_rtio_default on zephyrproject-rtos#79890. Signed-off-by: Luis Ubieda <luisf@croxel.com>
This patch fixes transaction op items not performed within a single SPI transfer. This is common for Write + Read commands, that depend on the CS kept asserted until the end, otherwise the context will be lost. A similar fix was applied to i2c_rtio_default on zephyrproject-rtos#79890. Signed-off-by: Luis Ubieda <luisf@croxel.com>
This patch fixes transaction op items not performed within a single SPI transfer. This is common for Write + Read commands, that depend on the CS kept asserted until the end, otherwise the context will be lost. A similar fix was applied to i2c_rtio_default on #79890. Signed-off-by: Luis Ubieda <luisf@croxel.com> (cherry picked from commit b5ca5b7)
This patch fixes transaction op items not performed within a single SPI transfer. This is common for Write + Read commands, that depend on the CS kept asserted until the end, otherwise the context will be lost. A similar fix was applied to i2c_rtio_default on zephyrproject-rtos#79890. Signed-off-by: Luis Ubieda <luisf@croxel.com>
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.