-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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_mcux_flexcomm: add transaction timeout option #68315
i2c_mcux_flexcomm: add transaction timeout option #68315
Conversation
Hello @guicnDell, and thank you very much for your first pull request to the Zephyr project! |
Hi @guicnDell , |
d64468e
to
2fb9aef
Compare
2fb9aef
to
6298d13
Compare
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.
https://docs.zephyrproject.org/latest/contribute/coding_guidelines/index.html#coding-guidelines
Rule 20.8 is not followed
996ed52
6298d13
to
996ed52
Compare
With the device_sync_sem semaphore, there is the possibility of the code not returning to give it back (mcux_flexcomm_master_transfer_callback is never called), causing it to get stuck in k_sem_take(&data->device_sync_sem, K_FOREVER) in subsequent calls. The i2c driver recovers by other means (enabling FSL_FEATURE_I2C_TIMEOUT_RECOVERY) but the callback might not return. Adding a timeout option allows for this occurrence to be avoided. Signed-off-by: Guilherme Casa Nova <guilherme.casa_nova@dell.com>
996ed52
to
0df8bd6
Compare
Hi @guicnDell! To celebrate this milestone and showcase your contribution, we'd love to award you the Zephyr Technical Contributor badge. If you're interested, please claim your badge by filling out this form: Claim Your Zephyr Badge. Thank you for your valuable input, and we look forward to seeing more of your contributions in the future! 🪁 |
With the device_sync_sem semaphore, there is the possibility of the code not returning to give it back (mcux_flexcomm_master_transfer_callback is never called), causing it to get stuck in k_sem_take(&data->device_sync_sem, K_FOREVER) in subsequent calls.
The i2c driver recovers by other means (enabling FSL_FEATURE_I2C_TIMEOUT_RECOVERY) but the callback might not return.
Adding a timeout option allows for this occurrence to be avoided.