Commit Graph

3 Commits

Author SHA1 Message Date
Vic Yang
a9541220dc Only waste 1 byte in queue buffer
For simplicity of the code, we don't allow (head == tail) when the queue
is full. But currently we are wasting the size of a single unit, while
we can actually just waste 1 byte. Let's fix this.

BUG=None
TEST=Pass the unit test.
BRANCH=None

Change-Id: Id09c20a9345ebb3ec0cad659afe36e25b422e688
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/58058
Reviewed-by: Yung-Chieh Lo <yjlou@chromium.org>
2013-06-10 01:48:44 -07:00
Vic Yang
8bed9853d7 Bug fix of queue empty slot calculation
Current implementation of queue_has_space doesn't handle the case where
queue tail has wrapped around the end. This CL fixes the bug.

BUG=None
TEST=Pass the test in the following CL.
BRANCH=link

Change-Id: I774f388081af50f0e930a6cbc3a723da1c8283b0
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/58031
Reviewed-by: Yung-Chieh Lo <yjlou@chromium.org>
2013-06-09 21:33:17 -07:00
Louis Yung-Chieh Lo
210ddfefcf Refactor the i8042 module to be thread-safe.
Any command/data coming from host will be placed in from_host queue, and
the interrupt handler returns immediately. The i8042_command_task() will
handle them later.

Data reply to the host will be protected by the mutex.

BUG=chrome-os-partner:10090
TEST=randomly play around on the link board.

Change-Id: Ic19d5abd1abf8dc261ddaad4224cd9305c2f36a4
Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/24299
Commit-Ready: Yung-Chieh Lo <yjlou%chromium.org@gtempaccount.com>
Reviewed-by: Yung-Chieh Lo <yjlou%chromium.org@gtempaccount.com>
Tested-by: Yung-Chieh Lo <yjlou%chromium.org@gtempaccount.com>
2012-06-07 20:48:51 -07:00