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

drivers/usbhid-ups.c: try to detect "Driver stale" situations when in "pollonly" mode #1630

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jimklimov
Copy link
Member

Currently the driver code does not seem to have any concept of "staleness" if it is not in interrupt mode (and failing those requests). Unplugging the USB cable has no effect on driver's ability and eagerness to report info about the device, even an hour later. I did not yet test if this is a platform issue (seen with Windows builds) or a generic one.

Not sure in practical terms however, if the trick in this PR helps - e.g. it might be prudent to actively re-request static fields known to have been served during initial startup, to make sure they are still served or the device is AWOL (assuming libusb actually requests that, and does not cache responses), but I am not quickly sure how to do that.

More expert eyes are welcome :)

…h "pollonly" mode, re-read HU_FLAG_SEMI_STATIC and HU_FLAG_STATIC entries to detect "Driver stale" situations [networkupstools#1624]
@jimklimov jimklimov marked this pull request as draft August 29, 2022 07:04
@jimklimov jimklimov added question need testing Code looks reasonable, but the feature would better be tested against hardware or OSes need more info labels Sep 2, 2022
@jimklimov
Copy link
Member Author

UPDATE: PR #2010 introduces state entry timestamping, so if it gets merged - we have another approach to the staleness detection problem generally (can just test in every loop if non-(semi)static values were last written longer than SOME_TIMEOUT ago).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug need more info need testing Code looks reasonable, but the feature would better be tested against hardware or OSes question USB
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant