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

nrf5x: Fix endpoint internal state when closed #1614

Merged
merged 1 commit into from
Aug 26, 2022

Conversation

kasjer
Copy link
Collaborator

@kasjer kasjer commented Aug 26, 2022

Describe the PR
Field started (regarding transfer) was only cleared when transfer
was finished.
For audio devices set interface is called many times.
When there is no audio (silence) set interface requests zero
length bandwidth that in turn calls dcd_edpt_close().

When endpoint is closed due to set interface request transfer
should not longer be started since it will block next start transfer
with assert.

This just sets 'started' to false when endpoint is closed.

Additional context
This mostly affects audio where dcd_edpt_close() is called often but
maybe is could be observed on other classes.

Field started (regardind transfer) was only cleaed when transfer
was finished.
For audio devices set interface is called many times.
When there is no audio (silence) set interface requests zero
lenght bandwithd that in turn calls dcd_edpt_close().

When endpoint is closed due to set interface request transfer
should not longer be started since it will block next start transfer
with assert.

This just sets 'started' to false when endpoint is closed.
@kasjer kasjer requested a review from hathach August 26, 2022 06:13
Copy link
Owner

@hathach hathach left a comment

Choose a reason for hiding this comment

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

great, thank for the fix.

@hathach hathach merged commit b624664 into hathach:master Aug 26, 2022
@kasjer kasjer deleted the kasjer/fix-nrf5x-with-iso branch August 26, 2022 06:49
@kasjer
Copy link
Collaborator Author

kasjer commented Aug 26, 2022

great, thank for the fix.

It was me who introduced this bug in the first place.
Thanks for quick review.

@hathach
Copy link
Owner

hathach commented Aug 26, 2022

great, thank for the fix.

It was me who introduced this bug in the first place. Thanks for quick review.

haha, not really, the bug is just an side-effect introduced along with a much more complicated race condition :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants