diff options
author | Alexandru M Stan <amstan@chromium.org> | 2015-04-27 16:50:04 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-04-28 20:53:50 +0000 |
commit | 0fc9f263641fc144d52e4a47ef9feed3247e285f (patch) | |
tree | 2dbcd7b6b529857cbeecabd234e8472b13bef9e0 /board/strago/board.c | |
parent | f19a1086bcf3e2758c0cc3c55c5c8468c518f365 (diff) | |
download | chrome-ec-0fc9f263641fc144d52e4a47ef9feed3247e285f.tar.gz |
stm32: spi: Fix race condition with the enabled boolean
Sometimes the chipset task is slow enough that we might get messages from
the AP before chipset_in_state(CHIPSET_STATE_ON) is true. This causes us
to leave the spi off after our usual reset after every transaction
(see chrome-os-partner:31390). This would put an end to any EC communications.
Instead of relying on CHIPSET_STATE_ON we could just save the value of
"enabled" before we turn it off, then use that as a condition instead.
There shouldn't be a race condition on "enabled" because the only other place
it gets modified is in the hooks, which can't preempt spi_init
(which usually happens in the host command task).
The only problem is that in case of a sysjump enabled will be 0,
so CHIPSET_STATE_ON was left as a backup to handle that case.
This fixup was squashed from Ied3788f83fef548dff3b01bec93d0e40101ba0f7
TEST=Resume minnie from "echo mem>/sys/power/state" a few times, note ec still works
BUG=chrome-os-partner:39564, chrome-os-partner:39576
BRANCH=veyron
Change-Id: I7c33243faebfd74dc33451024c1d75080babee03
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/267593
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'board/strago/board.c')
0 files changed, 0 insertions, 0 deletions