firmware: fix race conditions missed by pr #703 (+4 bytes XRAM) - #1064
Merged
whitequark merged 1 commit intoNov 2, 2025
Merged
Conversation
…tes XRAM). These were missed by PR GlasgowEmbedded#703, because they used `SETUP_EP0_BUF(2)` with a non-zero argument for Control OUT transfers. Even though these didn't follow libfx2's (old) rule, of setting length to 0 when using Control OUT transfers, they did mostly work, because the FX2 actually ignores the length on OUT transfers. PR GlasgowEmbedded#703 assumed that all non-zero `SETUP_EP0_BUF` calls were IN transfer, which was wrong, so these instances remained vulnerable to the race condition. This change fixes those too.
purdeaandrei
force-pushed
the
f_fix_race_conditions_missed_by_pr_703
branch
from
November 1, 2025 07:05
fcc32a2 to
740e185
Compare
Merged
via the queue into
GlasgowEmbedded:main
with commit Nov 2, 2025
682ebe6
16 of 18 checks passed
This file contains hidden or 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
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.
These were missed by PR #703, because they used
SETUP_EP0_BUF(2)with a non-zero argument for Control OUT transfers. Even though these didn't follow libfx2's (old) rule, of setting length to 0 when using Control OUT transfers, they did mostly work, because the FX2 actually ignores the length on OUT transfers.PR #703 assumed that all non-zero
SETUP_EP0_BUFcalls were IN transfer, which was wrong, so these instances remained vulnerable to the race condition. This change fixes those too.