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

USBv5: Fix racy device change behavior #10512

Merged
merged 1 commit into from Mar 15, 2022

Conversation

stblr
Copy link
Contributor

@stblr stblr commented Mar 14, 2022

No description provided.

This prevents the device changes happening between 2 GETDEVICECHANGE
calls from being missed by the application.
Copy link
Member

@leoetlino leoetlino left a comment

Choose a reason for hiding this comment

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

If I understand correctly, this fixes a race in the following situation:

  • GetDeviceChange ioctl issued by the PPC
  • reply triggered
  • device change event
  • GetDeviceChange ioctl issued by the PPC -- this should immediately trigger a reply but doesn't in the current implementation, and this is what the PR fixes. Is that correct?

Source/Core/Core/IOS/USB/USBV5.cpp Show resolved Hide resolved
@stblr
Copy link
Contributor Author

stblr commented Mar 15, 2022

If I understand correctly, this fixes a race in the following situation:

* GetDeviceChange ioctl issued by the PPC

* reply triggered

* device change event

* GetDeviceChange ioctl issued by the PPC -- this should immediately trigger a reply but doesn't in the current implementation, and this is what the PR fixes. Is that correct?

That's correct.

@leoetlino leoetlino merged commit c883ec1 into dolphin-emu:master Mar 15, 2022
10 checks passed
@stblr stblr deleted the device-change branch March 15, 2022 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants