diff options
author | Shawn Nematbakhsh <shawnn@chromium.org> | 2016-10-20 14:59:53 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-10-26 01:45:25 -0700 |
commit | 907c09ee381ed53c7b081379ba71ed69fb062293 (patch) | |
tree | 5ebbd0b5dd3a83dc8bdcaf3e8e2404bc6ba34cef /common | |
parent | fffea303b4a0892a51d6dad5e903d7869deff13c (diff) | |
download | chrome-ec-907c09ee381ed53c7b081379ba71ed69fb062293.tar.gz |
task: Don't propagate TASK_EVENT_TIMER between between waits
In __wait_evt(), if a timer expiration occurs after we read event
status, before the timer is canceled, then TASK_EVENT_TIMER will be
propagated to the next task wait, likely leading to premature timeout.
Prevent this by clearing TASK_EVENT_TIMER after canceling our timer.
BUG=chrome-os-partner:58658
BRANCH=gru
TEST=Manual on gru, run 'pd # hard' for 12 hours with charger attached,
verify no TCPC I2C read errors occur.
Change-Id: Iac2f05a768b4ef29f82e7c3eb899f4c7dd5c3744
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/400968
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/timer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/timer.c b/common/timer.c index bda3e9c197..0440aaecab 100644 --- a/common/timer.c +++ b/common/timer.c @@ -137,8 +137,8 @@ void timer_cancel(task_id_t tskid) atomic_clear(&timer_running, 1 << tskid); /* - * Don't need to cancel the interrupt: it would be slow, just do it on - * the next IT + * Don't need to cancel the hardware timer interrupt, instead do + * timer-related housekeeping when the next timer interrupt fires. */ } |