summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorEric Yilun Lin <yllin@chromium.org>2022-04-11 13:59:50 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-04-12 02:56:14 +0000
commit06bbb13141acef66ded7141cc6b6a6eaf9dbca53 (patch)
tree996dc241eda9108c6a6757bb8801aeedde848db0 /common
parent4a7cea931e8980ed1b4e431e8bc06f03137d54fd (diff)
downloadchrome-ec-06bbb13141acef66ded7141cc6b6a6eaf9dbca53.tar.gz
drive/charger/isl923x: Fix race condition with discharge_on_ac
This CL is basically a clone of CL:3579624 which fixes the same issue on isl9241 driver. The below comment was copied from it: There is a race condition with `learn_mode`. This variable is read and then discharge_on_ac is disabled if it is not set. However it's possible for isl9241_discharge_on_ac to get called after the branch is taken but before discharge_on_ac is disabled. This can cause factory USB charging tests to fail as discharge_on_ac is disabled improperly. This commit protects the read and branch on `learn_mode` with a mutex to prevent the above from happening. BUG=b:214341758, b:206601685 TEST=zmake testall BRANCH=asurada, cherry Change-Id: I5d584b4b5f87e5f8a356e4f2bc8f6f37fd54250a Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3581823 Reviewed-by: Rob Barnes <robbarnes@google.com> Commit-Queue: Eric Yilun Lin <yllin@google.com> Tested-by: Eric Yilun Lin <yllin@google.com>
Diffstat (limited to 'common')
0 files changed, 0 insertions, 0 deletions