mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-10 17:41:54 +00:00
us_to_rtcss() could return an invalid value when us approached 1 sec due to precision loss in the divisor. Change the calculation order to divide last to eliminate precision loss. BUG=b:68185182 BRANCH=None TEST=On scarlet, Verify hw clock closely matches reality w/ low-power idle. Verify EC doesn't watchdog for 5 hours in S5 / G3 w/ low-power idle. Verify suspend-stress-test still succeeds to wake device on alarm. Change-Id: Id40797dd4291e94a54a09bbbdbc1a7f7a00a01b4 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/818332 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Brian Norris <briannorris@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Philip Chen <philipchen@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>