-
Notifications
You must be signed in to change notification settings - Fork 89
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
fix(PeriphDrivers): Calculate I3C timeout based on data size #1296
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ttmut
changed the title
fix(PeriphDrivers)Calculate I3C read timeout based on input size and SCL frequency
fix(PeriphDrivers): Calculate I3C read timeout based on read size
Dec 13, 2024
ttmut
force-pushed
the
fix/i3c_timeout
branch
from
December 16, 2024 09:15
1c6d39e
to
0bfd3f1
Compare
ttmut
changed the title
fix(PeriphDrivers): Calculate I3C read timeout based on read size
fix(PeriphDrivers): Calculate I3C timeout based on data size
Dec 16, 2024
ttmut
force-pushed
the
fix/i3c_timeout
branch
from
December 16, 2024 11:14
0bfd3f1
to
6beb170
Compare
alperenguclu
approved these changes
Dec 16, 2024
@@ -612,7 +616,9 @@ int MXC_I3C_RevA_Controller_Transaction(mxc_i3c_reva_regs_t *i3c, const mxc_i3c_ | |||
goto err; | |||
} | |||
|
|||
ret = MXC_I3C_RevA_WriteTXFIFO(i3c, req->tx_buf, req->tx_len, true, 100); | |||
timeout = (uint32_t)(40 * 1000000 / freq) * req->tx_len; |
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.
Would be helpful to add a comment on what the formula is or how this timeout calculation was derived.
Default timeout values used during transactions fall short on large data transfers. Use SCL frequency and data size to calculate a dynamic timeout value. Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
ttmut
force-pushed
the
fix/i3c_timeout
branch
from
December 16, 2024 20:02
6beb170
to
b1d70b1
Compare
sihyung-maxim
approved these changes
Dec 16, 2024
Will merge after Alperen reviews. |
alperenguclu
approved these changes
Dec 16, 2024
sihyung-maxim
pushed a commit
to analogdevicesinc/hal_adi
that referenced
this pull request
Dec 16, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Default timeout values used for transactions fall short on large data transfers. Use data size and SCL frequency to calculate a proper timeout value.
Below formulas are used to come up with rough estimations.
timeout = (40 * period_in_us) * writeCount
timeout = (80 * period_in_us) * readCount