Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a8967b29 authored by Jack Pham's avatar Jack Pham
Browse files

usb: pd: Improve timing accuracy



queue_delayed_work(), which is based on jiffies, is not
appropriate for accurate timing, such as timeouts needing
resolution on the order of milliseconds. Instead introduce
an hrtimer which upon timeout will call regular queue_work().
Redefine timeout values based on the PD spec minimum amounts
as these are generally the minimum time the policy engine
needs to wait before peforming the next action.

msleep() is also jiffies-based, so replace with usleep_range()
for the same reason. Further, PE_SRC_TRANSITION_SUPPLY can
simply be inlined as part of the PE_SRC_NEGOTIATE_CAPABILITY state
using an in-place sleep.

Change-Id: Id8c9eb8937b67d4deaad8b61d9ff2349cbe7f4ed
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent 33213bde
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment