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

usbus: Implement USB_FEATURE_DEVICE_REMOTE_WAKEUP handling #19800

Merged
merged 1 commit into from
Jul 7, 2023

Conversation

zvecr
Copy link
Contributor

@zvecr zvecr commented Jul 5, 2023

Contribution description

While working on the qmk_firmware integration, a slight behavioural difference was noted in Windows 10/11 hosts.

Stalling on SET_FEATURE/CLEAR_FEATURE can make upstream hubs disable ports. This in turn stops the device from instantiating a remote wakeup (currently implemented with some MCU specific logic).

According to the USB 2.0 spec, remote wakeup should be disabled by default, and should only be enabled if the host explicitly requests it. Handling USB_FEATURE_DEVICE_REMOTE_WAKEUP and storing its status allows devices to also be more compliant in its wakeup process.

Testing procedure

Right now its been tested via wireshark and a heavily modified qmk_firmware branch.
Please do let me know if theres existing test cases to update.

Hardware tested was a ATSAMD51J18A MCU and USB2422 Hub, as well as ATSAMD21G18 and nrf52840.

Issues/PRs references

@zvecr zvecr requested review from bergzand, dylad and aabadie as code owners July 5, 2023 22:54
@github-actions github-actions bot added Area: USB Area: Universal Serial Bus Area: sys Area: System labels Jul 5, 2023
@benpicco benpicco requested a review from gschorcht July 5, 2023 23:01
@dylad dylad added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jul 7, 2023
@riot-ci
Copy link

riot-ci commented Jul 7, 2023

Murdock results

✔️ PASSED

9139813 Implement USB_FEATURE_DEVICE_REMOTE_WAKEUP handling

Success Failures Total Runtime
6936 0 6936 09m:02s

Artifacts

Copy link
Member

@dylad dylad left a comment

Choose a reason for hiding this comment

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

ACK.
Looks good to me.

@dylad
Copy link
Member

dylad commented Jul 7, 2023

bors merge

@bors
Copy link
Contributor

bors bot commented Jul 7, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot merged commit 735d371 into RIOT-OS:master Jul 7, 2023
@benpicco benpicco added this to the Release 2023.07 milestone Aug 2, 2023
@zvecr zvecr deleted the remote_wake_pr branch December 17, 2023 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: sys Area: System Area: USB Area: Universal Serial Bus CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants