Skip to content

firmware: fix race conditions missed by pr #703 (+4 bytes XRAM) - #1064

Merged
whitequark merged 1 commit into
GlasgowEmbedded:mainfrom
purdeaandrei:f_fix_race_conditions_missed_by_pr_703
Nov 2, 2025
Merged

firmware: fix race conditions missed by pr #703 (+4 bytes XRAM)#1064
whitequark merged 1 commit into
GlasgowEmbedded:mainfrom
purdeaandrei:f_fix_race_conditions_missed_by_pr_703

Conversation

@purdeaandrei

Copy link
Copy Markdown
Contributor

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_BUF calls were IN transfer, which was wrong, so these instances remained vulnerable to the race condition. This change fixes those too.

…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
purdeaandrei force-pushed the f_fix_race_conditions_missed_by_pr_703 branch from fcc32a2 to 740e185 Compare November 1, 2025 07:05

@whitequark whitequark left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@whitequark
whitequark added this pull request to the merge queue Nov 2, 2025
Merged via the queue into GlasgowEmbedded:main with commit 682ebe6 Nov 2, 2025
16 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants