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

Vendor device race condition fix #1989

Merged

Conversation

epatstarkey
Copy link
Contributor

Use usbd_edpt_claim, usbd_edpt_release in vendor device class

An issue similar to #1470 was discovered in my testing on a PCA10059 running MyNewt/Nimble. This PR ports over the use of the endpoint claim and release mechanisms used in the cdc class, which seems similar. This resolved the race condition I encountered that would result in IN transfers getting stuck until the next OUT transfer was started.

@epatstarkey
Copy link
Contributor Author

Sample updated that I missed earlier. It should pass the gated build now.

@epatstarkey
Copy link
Contributor Author

Trailing whitespace removed that cause the pre-commit to fail. The rest passed.

Copy link
Collaborator

@HiFiPhile HiFiPhile left a comment

Choose a reason for hiding this comment

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

Thanks for your PR, tested ok on my LPC55S66 custom board.

@epatstarkey epatstarkey closed this Apr 2, 2023
@epatstarkey epatstarkey reopened this Apr 2, 2023
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.

look good, thank you. There is quite of duplication code for driver with stream/buffered endpoint. I have added tu_edpt_stream (read/write) API. In the future we will migrate to those instead
https://github.com/hathach/tinyusb/blob/master/src/common/tusb_private.h#L124

currently only cdc host used this stream edpt https://github.com/hathach/tinyusb/blob/master/src/class/cdc/cdc_host.c#L61

@hathach hathach merged commit 4c5104f into hathach:master Apr 4, 2023
65 checks passed
@epatstarkey epatstarkey deleted the vendor_device_race_condition_fix branch October 9, 2023 15:50
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.

None yet

3 participants