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

[pcsc] Retry init on more errors, try USB reset #1164

Merged
merged 7 commits into from
May 21, 2024
Merged

Conversation

emaxx-google
Copy link
Collaborator

Change the init retry mechanism to be triggered on any reader initialization error, as opposed to only doing it on openDevice/claimInterface errors. Additionally, attempt resetting the USB device after a few unsuccessful retries.

This should fix occasional flaky errors we see in the field, when there's a temporary conflict between the in-session and the login-screen instances of Smart Card Connector, which may cause failures at various USB functions and accidentally receiving a reply for a request sent by a different extension ("Invalid frame detected").

@emaxx-google emaxx-google marked this pull request as draft May 14, 2024 13:01
@emaxx-google
Copy link
Collaborator Author

One of the tests failed - seems like a real problem with composite devices. Looking into it.

Copy link

Continuous Integration: All tests passed.
C/C++ test coverage: 73.58% lines.

@emaxx-google
Copy link
Collaborator Author

One of the tests failed - seems like a real problem with composite devices. Looking into it.

Fixed now.

@emaxx-google emaxx-google marked this pull request as ready for review May 14, 2024 16:51
Base automatically changed from test-usb-error to main May 15, 2024 12:03
Change the init retry mechanism to be triggered on any reader
initialization error, as opposed to only doing it on
openDevice/claimInterface errors. Additionally, attempt resetting the
USB device after a few unsuccessful retries.

This should fix occasional flaky errors we see in the field, when
there's a temporary conflict between the in-session and the login-screen
instances of Smart Card Connector, which may cause failures at various
USB functions and accidentally receiving a reply for a request sent by a
different extension ("Invalid frame detected").
Copy link

Continuous Integration: All tests passed.
C/C++ test coverage: 73.58% lines.

@emaxx-google emaxx-google merged commit d63dd12 into main May 21, 2024
13 checks passed
@emaxx-google emaxx-google deleted the reset-usb-on-errors branch May 21, 2024 08:24
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.

None yet

2 participants