Skip to content
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

make sure transfers to device after reset/before setup are ignored #2840

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Olstyle
Copy link

@Olstyle Olstyle commented Oct 14, 2024

Fixes #2322

Describe the PR
In cases of bus reset, there can be pending transfers in the queue. Or a defective host just sends transfers without a proper setup. In both cases this lead to null pointer access after driver lookup(or assert if debug is enabled).
This small check fixes this.

Additional context
I checked the throughput on my STM32U5 base MSC device and could not see a performance hit. Though I am limited at around 256KB/s read speed anyway. I have seen pending transfer after reset with a Win10 host and the linked issue is from Linux, so the problem seems to be universal.
Another option would be to clear the queue on bus reset, but this doesn't fix unexpected transfers and also needs a bit of research to make it work on all supported operating systems.

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.

USB MSC has some sort of race condition
1 participant