mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-01 21:02:27 +00:00
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>
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user