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

Rumble protocol throttling and concurrency fixups #204

Merged
merged 6 commits into from
Jun 27, 2020

Conversation

kakra
Copy link
Collaborator

@kakra kakra commented Jun 20, 2020

Please test.

Otherwise we may give user space an inconsistent view of the battery
and power supply status.

Signed-off-by: Kai Krakow <[email protected]>
Otherwise we may work on a partially updated structure and that may
leave the rumble motors running without letting the driver know it.

Signed-off-by: Kai Krakow <[email protected]>
@kakra kakra force-pushed the tests/throttle-rumble-protocol branch 2 times, most recently from f180750 to 9f0c15f Compare June 27, 2020 12:00
Thanks to @medusalix great findings that the controller crashes are
most probably indeed a timing issue, this commit introduces a
modified rumble protocol which throttles rumble commands sent to the
controller. Also, it seems we cannot rely on `ff-memless` to only send
us commands once per 50ms although that's the proposed time resolution
of the protocol. It may depend on kernel HZ setting.

This commit migrates the rumble worker into a delayed worker. When
programming a rumble motor, we now remember the timing and allow the
next reprogramming only 10ms+ in the future. Further requests will be
buffered and the final command will be replayed to the controller when
the delayed worker finally runs. Care was taken that we do not
accidentally introduce a fixed lag of 10ms for rumble events.

Maybe-fixes: atar-axis#180
Fixes: atar-axis#189
Signed-off-by: Kai Krakow <[email protected]>
@kakra kakra force-pushed the tests/throttle-rumble-protocol branch from 9f0c15f to 5b8ffcf Compare June 27, 2020 12:06
@codeclimate
Copy link

codeclimate bot commented Jun 27, 2020

Code Climate has analyzed commit 5b8ffcf and detected 0 issues on this pull request.

View more on Code Climate.

@kakra kakra merged commit 8e7eba3 into atar-axis:master Jun 27, 2020
@kakra
Copy link
Collaborator Author

kakra commented Jun 27, 2020

Tested for multiple hours without problems.

@kakra kakra deleted the tests/throttle-rumble-protocol branch July 25, 2020 14:47
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.

1 participant