summaryrefslogtreecommitdiff
path: root/power/stoney.c
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2018-01-04 16:28:42 -0800
committerchrome-bot <chrome-bot@chromium.org>2018-05-21 18:19:24 -0700
commit1168e4e70f4b67755478f4ea7eb006e6bb97bb9e (patch)
treed642d7805d5f154f323aa7ff7a46e3de0ec2f8ea /power/stoney.c
parent1de987735a42438c5fc82f0616b5af5645fd9fe5 (diff)
downloadchrome-ec-1168e4e70f4b67755478f4ea7eb006e6bb97bb9e.tar.gz
charger: Modify manual mode to save desired current/voltage
Previously manual_mode used the current values of voltage/current to set the desired values for each charge_request() call. Since manual mode is entered/exited in the host command task, this can easily lead to a race condition where the charger gets disabled in the host command task, the reenabled by the charger task. This in turn makes the ectool chargecontrol idle command unreliable. This CL replaces manual mode with two variables, manual_voltage and manual_current. The default values are -1 which means that they are inactive. When the ectool command 'chargecontrol idle' is executed, it sets both variables to 0. This then removes the race condition possibility as each iteration of the charger loop will use manual_voltage and/or manual_current if not -1. BRANCH=coral BUG=b:68364154 TEST=Manual Executed 'ectool chargecontrol idle' and 'ectool chargecontrol normal' numerous times and verified that the charging was disabled/resumed each time as expected. Without this fix the problem could be reproduced always in less than 10 attempts, typcially less than 5. With this CL charging is disabled reliably each time and I'm not able to reproduce the problem. Change-Id: I1ed9cdb42249cdf72ab34dd95b8f42c09d9a490c Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/851419 Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org> (cherry picked from commit b7254f38979f274acc66330905399ff5ddf4129b) Reviewed-on: https://chromium-review.googlesource.com/922069 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'power/stoney.c')
0 files changed, 0 insertions, 0 deletions