summaryrefslogtreecommitdiff
path: root/include/task.h
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2012-09-21 14:23:09 -0700
committerGerrit <chrome-bot@google.com>2012-09-21 16:48:54 -0700
commitef71b1a3e56efb86b888edc6c04240f3eb970bd2 (patch)
treea779c859b14ce4300f11036c8ea5599e2216b687 /include/task.h
parente802e4fa37e1506ef19a5e38f86decbaa0ca0121 (diff)
downloadchrome-ec-ef71b1a3e56efb86b888edc6c04240f3eb970bd2.tar.gz
Prevent I2C interrupts from consuming pending task events
This manifested as the lightbar task missing transitions between CPU states. The underlying cause was that when a task talks over the I2C bus, the I2C communication was using the task scheduler to wait for an interrupt to signal completed I2C traffic without blocking the other threads, but while doing so it was not preserving pending events. This CL seems to fix it. BUG=chrome-os-partner:12431 BRANCH=all TEST=manual The original bug is tricky to reproduce without adding some delay to the I2C task code, but you can do it. Boot the CPU, then from the EC console repeatedly alternate these two commands: lightbar seq s0 lightbar seq s3 You should see the lightbar pattern turn off and on, but occasionally you'll type the command and the EC won't change the pattern. With this change applied, it should *always* work. Change-Id: Ie6819a4a36162a8760455c71c41ab8a468656af1 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/33805 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'include/task.h')
-rw-r--r--include/task.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/task.h b/include/task.h
index 2362d077c8..c6b8b4591d 100644
--- a/include/task.h
+++ b/include/task.h
@@ -13,7 +13,8 @@
#include "task_id.h"
/* Task event bitmasks */
-#define TASK_EVENT_CUSTOM(x) (x & 0x1fffffff)
+#define TASK_EVENT_CUSTOM(x) (x & 0x0fffffff)
+#define TASK_EVENT_I2C_IDLE (1 << 28) /* I2C interrupt handler event. */
#define TASK_EVENT_WAKE (1 << 29) /* task_wake() called on task */
#define TASK_EVENT_MUTEX (1 << 30) /* Mutex unlocking */
#define TASK_EVENT_TIMER (1 << 31) /* Timer expired. For example,