Skip to content

Fix 1st nak retry one frame shorter. #3088

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

Merged
merged 2 commits into from
Apr 21, 2025
Merged

Fix 1st nak retry one frame shorter. #3088

merged 2 commits into from
Apr 21, 2025

Conversation

HiFiPhile
Copy link
Collaborator

@HiFiPhile HiFiPhile commented Apr 18, 2025

Describe the PR
A small fix following #3072.

When we enable SOF interrupt the 1st time it could be already pending but uncleared, in hcd_int_handler gintsts = dwc2->gintsts & gintmsk, since gintmsk is unset yet gintsts is also unset, in result SOF flag is not cleared.

Cause SOF fire immediately and retry interval shorter, 2nd poll should happen at 63ms instead.

usbpv_SpP7rHuANO

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.

Thank you.

PS: maybe we should check if sof is already enabled, if not then clear the pending and enabled. Clear pending while sof enabled can possibly skip that event since this can run within isr.

@HiFiPhile
Copy link
Collaborator Author

Yeah it's safer to check if sof is already enabled, I think it can only happen if CPU usage is very high which makes latency in processing.

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.

perfect, thank you.

@hathach hathach merged commit 56ed51c into hathach:master Apr 21, 2025
108 checks passed
@HiFiPhile HiFiPhile deleted the intv branch April 22, 2025 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants