diff options
author | Vincent Palatin <vpalatin@chromium.org> | 2012-07-25 18:17:08 +0000 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-07-25 13:40:56 -0700 |
commit | 36a3989fc437c513bcbeee7977d96239e7fe6295 (patch) | |
tree | 7f36e1b22efdf7622d256e392ec1d1008e7ae97f | |
parent | 0e82420f1203547e5ac3365933f00acc31c49daf (diff) | |
download | chrome-ec-36a3989fc437c513bcbeee7977d96239e7fe6295.tar.gz |
don't crash when receiving ACPI query on legacy channel
When updating the EC and BIOS, we have to run for some times the new EC
with the old BIOS (after we have upgraded the first half of the EC and
before rebooting the machine), let's handle the ACPI request so the
kernel is not sending them into a loop triggering a reboot of the
machine.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:11821
TEST=update a Link EVT using "chromeos-firmware --mode=factory" from
current BCS binaries (EC v1.1.104-b8d7d8f / Firmware 2476) to next
candidates ( EC v1.1.301 / Firmware 2657).
Change-Id: I115a42e6c33c143cbdc38341dcf7e0f61a8bd771
Reviewed-on: https://gerrit.chromium.org/gerrit/28409
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r-- | chip/lm4/lpc.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/chip/lm4/lpc.c b/chip/lm4/lpc.c index 78dbdb6dda..58bb1d4225 100644 --- a/chip/lm4/lpc.c +++ b/chip/lm4/lpc.c @@ -366,6 +366,30 @@ static void handle_acpi_command(void) lpc_generate_sci(); } +/** + * We have received an unexpected ACPI request on the normal command channel + * from an old firmware/kernel, try to somewhat answer it. + */ +static int acpi_on_bad_channel(struct host_cmd_handler_args *args) +{ + int i; + int result = 0; + + for (i = 0; i < 32; i++) { + if (host_events & (1 << i)) { + host_clear_events(1 << i); + result = i + 1; /* Events are 1-based */ + break; + } + } + + return result; +} +DECLARE_HOST_COMMAND(EC_CMD_ACPI_QUERY_EVENT, + acpi_on_bad_channel, + EC_VER_MASK(0)); + + /* Handle an incoming host command */ static void handle_host_command(int cmd) { |