From: Michael Brown Date: Mon, 11 Jul 2016 20:23:03 +0000 (+0100) Subject: [acpi] Allow time for ACPI power off to take effect X-Git-Tag: v1.20.1~395 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df85901768622b8aea94d39a28effdbf90f7d4f0;p=thirdparty%2Fipxe.git [acpi] Allow time for ACPI power off to take effect The ACPI power off sequence may not take effect immediately. Delay for one second, to eliminate potentially confusing log messages such as "Could not power off: Error 0x43902001 (http://ipx". Reported-by: Leonid Vasetsky Signed-off-by: Michael Brown --- diff --git a/src/arch/x86/interface/pcbios/acpipwr.c b/src/arch/x86/interface/pcbios/acpipwr.c index 63b986b68..d19f972d5 100644 --- a/src/arch/x86/interface/pcbios/acpipwr.c +++ b/src/arch/x86/interface/pcbios/acpipwr.c @@ -23,6 +23,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); +#include #include #include #include @@ -111,6 +112,11 @@ int acpi_poweroff ( void ) { ACPI_PM1_CNT_SLP_EN ), pm1b_cnt ); } + /* On some systems, execution will continue briefly. Delay to + * avoid potentially confusing log messages. + */ + mdelay ( 1000 ); + DBGC ( colour, "ACPI power off failed\n" ); return -EPROTO; }