]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[acpi] Allow time for ACPI power off to take effect
authorMichael Brown <mcb30@ipxe.org>
Mon, 11 Jul 2016 20:23:03 +0000 (21:23 +0100)
committerMichael Brown <mcb30@ipxe.org>
Mon, 11 Jul 2016 20:23:03 +0000 (21:23 +0100)
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 <leonidv@velostrata.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/arch/x86/interface/pcbios/acpipwr.c

index 63b986b68ba7975841aaae3b67fe0c39fec18306..d19f972d5e7de1657ae900e8800d631ae05638d4 100644 (file)
@@ -23,6 +23,7 @@
 
 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
 
+#include <unistd.h>
 #include <errno.h>
 #include <byteswap.h>
 #include <realmode.h>
@@ -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;
 }