ACPI reboot
Len Brown
reviewerYakui,
I think your patch below from
http://bugzilla.kernel.org/show_bug.cgi?id=11481
is close, but not quite right.
"reboot=a" should not be necessary, as reboot_type = BOOT_ACPI by default, yes?
Re: DMI to ignore a missing (acpi_gbl_FADT.flags & ACPI_FADT_RESET_REGISTER)....
If we need DMI,
it should be checked at _boot_ time, not at _reboot_ time, and the table should be marked _initdata.
But the real question is if we should be checking this bit at all. The fact that we are adding DMI to ignore it suggest that we should think about ignoring it by default, and instead perhaps sanity checking acpi_gbl_FADT.reset_register and basing our decision to use it on that?
thanks,
-Len
-----------
Subject: ACPI: Add the DMI check table to support ACPI reboot
From: Zhao Yakui <[email protected]>
On some broken laptops the system can't be rebooted after it is resumed from S3. The system can be rebooted by writting RESET_VALUE to RESET_REGISTER although the ACPI_FADT_RESET_REGISTER bit in the FADT flag indicates that ACPI reboot mechanism is not supported.
Maybe it is appropriate that the acpi_reboot DMI checkt table is added so that the ACPI reboot is used forcibly on some broken laptops in case of adding the boot option of "reboot=a".
http://bugzilla.kernel.org/show_bug.cgi?id=7299
http://bugzilla.kernel.org/show_bug.cgi?id=11481
--- drivers/acpi/reboot.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-)
drivers/acpi/reboot.c +24 -1
@@ -3,6 +3,22 @@#include <linux/acpi.h> #include <acpi/reboot.h> +const static struct dmi_system_id reboot_dmi_table[] = { + { +NULL ,"Asus M3N board" , { +DMI_MATCH (DMI_BIOS_VERSION ,"0207" ), +DMI_MATCH (DMI_BIOS_DATE ,"03/16/2004" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"M3N" ), +DMI_MATCH (DMI_BOARD_NAME ,"M3N" ) },NULL }, + { +NULL ,"Asus M6NE board" , { +DMI_MATCH (DMI_BIOS_VERSION ,"0208" ), +DMI_MATCH (DMI_BIOS_DATE ,"03/28/2005" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"M6Ne" ), +DMI_MATCH (DMI_BOARD_NAME ,"M6Ne" ) },NULL }, + {}, +}; +void acpi_reboot (void ) {struct acpi_generic_address *rr;
@@ -16,7 +32,14 @@ void acpi_reboot(void) rr = &acpi_gbl_FADT.reset_register;/* Is the reset register supported? */ -if (!(acpi_gbl_FADT.flags &ACPI_FADT_RESET_REGISTER ) || +if (dmi_check_system (reboot_dmi_table)) { +/* +* If the laptop falls into the DMI check table, the +* ACPI reboot mechanism will be used forcibly regardless of +* the ACPI_FADT_RESET_REGISTER bit flag. +*/ +printk (KERN_DEBUG "ACPI reboot mechanism will be used\n" ); + }else if (!(acpi_gbl_FADT.flags &ACPI_FADT_RESET_REGISTER ) || rr->bit_width !=8 || rr->bit_offset !=0 )return ;
Quoted 7 lines · Len Brown
Yakui,
I think your patch below from
http://bugzilla.kernel.org/show_bug.cgi?id=11481
is close, but not quite right."reboot=a" should not be necessary, as
reboot_type=BOOT_ACPIby default, yes?
the default reboot_type is BOOT_KBD. So it is necessary to add the boot option of "reboot=a" to use the ACPI reboot mechanism.
Quoted 6 lines
Re: DMI to ignore a missing (acpi_gbl_FADT.flags &
ACPI_FADT_RESET_REGISTER)....If we need DMI,
it should be checked at _boot_ time, not at _reboot_ time, and the table should be marked_initdata.
Ok. I will refresh it. The DMI table will be put into _initdata section.
Quoted 6 lines
But the real question is if we should be checking this bit at all. The fact that we are adding DMI to ignore it suggest that we should think about ignoring it by default, and instead perhaps sanity checking acpi_gbl_FADT.reset_register and basing our decision to use it on that?
According to the ACPI spec the bit indicates whether the ACPI reset mechanism is supported. If it is zero, maybe OS should not use the ACPI reset mechanism even when ACPI_RESET_REG is defined.
On some laptops the system can't be rebooted by using default reboot_type(BOOT_KBD) after it is resumed from S3. If the ACPI reboot is used, the system can be rebooted. But unfortunately the FADT flag bit indicates that ACPI reboot mechanism is not supported. This seems contradictory.
In the patch the FADT flag bit is checked to comply with the ACPI spec. But in order to use the ACPI reboot mechanism on some laptops, the DMI check table is added in which the FADT flag bit is ignored.
Of course what you said is also OK. When the system is expected to be rebooted using the ACPI reboot mechanism, the FADT flag bit is ignored and instead reset_register/reset_value is checked. If so, the DMI check table is redundant.
I will refresh the patch based on your suggestion. Thanks.
Quoted 68 lines
thanks,
-Len
-----------Subject: ACPI: Add the DMI check table to support ACPI reboot
From: Zhao Yakui <[email protected]>On some broken laptops the system can't be rebooted after it is resumed from S3. The system can be rebooted by writting
RESET_VALUEtoRESET_REGISTERalthough theACPI_FADT_RESET_REGISTERbit in the FADT flag indicates that ACPI reboot mechanism is not supported.Maybe it is appropriate that the
acpi_rebootDMI checkt table is added so that the ACPI reboot is used forcibly on some broken laptops in case of adding the boot option of "reboot=a".http://bugzilla.kernel.org/show_bug.cgi?id=7299
http://bugzilla.kernel.org/show_bug.cgi?id=11481Signed-off-by Zhao Yakui <[email protected]>--- drivers/acpi/reboot.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-)Index:
linux-2.6/drivers/acpi/reboot.c
===================================================================drivers/acpi/reboot.c +24
-1@@ -3,6 +3,22 @@#include <linux/acpi.h> #include <acpi/reboot.h> +const static struct dmi_system_id reboot_dmi_table[] = { + { +NULL ,"Asus M3N board" , { +DMI_MATCH (DMI_BIOS_VERSION ,"0207" ), +DMI_MATCH (DMI_BIOS_DATE ,"03/16/2004" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"M3N" ), +DMI_MATCH (DMI_BOARD_NAME ,"M3N" ) },NULL }, + { +NULL ,"Asus M6NE board" , { +DMI_MATCH (DMI_BIOS_VERSION ,"0208" ), +DMI_MATCH (DMI_BIOS_DATE ,"03/28/2005" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"M6Ne" ), +DMI_MATCH (DMI_BOARD_NAME ,"M6Ne" ) },NULL }, + {}, +}; +void acpi_reboot (void ) {struct acpi_generic_address *rr;@@ -16,7 +32,14 @@ void acpi_reboot(void) rr = &acpi_gbl_FADT.reset_register;/* Is the reset register supported? */ -if (!(acpi_gbl_FADT.flags &ACPI_FADT_RESET_REGISTER ) || +if (dmi_check_system (reboot_dmi_table)) { +/* +* If the laptop falls into the DMI check table, the +* ACPI reboot mechanism will be used forcibly regardless of +* the ACPI_FADT_RESET_REGISTER bit flag. +*/ +printk (KERN_DEBUG "ACPI reboot mechanism will be used\n" ); + }else if (!(acpi_gbl_FADT.flags &ACPI_FADT_RESET_REGISTER ) || rr->bit_width !=8 || rr->bit_offset !=0 )return ;
Len Brown
reviewerQuoted 11 lines · Zhao Yakui
Quoted 7 lines · Len Brown
Yakui,
I think your patch below from
http://bugzilla.kernel.org/show_bug.cgi?id=11481
is close, but not quite right."reboot=a" should not be necessary, as
reboot_type=BOOT_ACPIby default, yes?the default
reboot_typeisBOOT_KBD. So it is necessary to add the boot option of "reboot=a" to use the ACPI reboot mechanism.
hmm, arch/x86/kernel/reboot.c has this:
/*
* Keyboard reset and triple fault may result in INIT, not RESET, which
* doesn't work when we're in vmx root mode. Try ACPI first. */
enum reboot_type reboot_type = BOOT_ACPI;
Am I mis-reading the code?
Quoted 9 lines
Quoted 6 lines
Re: DMI to ignore a missing (acpi_gbl_FADT.flags &
ACPI_FADT_RESET_REGISTER)....If we need DMI,
it should be checked at _boot_ time, not at _reboot_ time, and the table should be marked_initdata.Ok. I will refresh it. The DMI table will be put into
_initdatasection.
I'm okay with a DMI entry now, but only if we work on figuring out how to delete the DMI entries to fix the problem for all system w/o using DMI.
Quoted 9 lines
Quoted 5 lines
But the real question is if we should be checking this bit at all. The fact that we are adding DMI to ignore it suggest that we should think about ignoring it by default, and instead perhaps sanity checking acpi_gbl_FADT.reset_register and basing our decision to use it on that?
According to the ACPI spec the bit indicates whether the ACPI reset mechanism is supported. If it is zero, maybe OS should not use the ACPI reset mechanism even when
ACPI_RESET_REGis defined.
understood.
Quoted 5 lines
On some laptops the system can't be rebooted by using default
reboot_type(BOOT_KBD)after it is resumed from S3. If the ACPI reboot is used, the system can be rebooted. But unfortunately the FADT flag bit indicates that ACPI reboot mechanism is not supported. This seems contradictory.
This contradiction suggests that Windows is not following the ACPI spec, and is not checking the FADT bit before using the ACPI reboot mechanism.
Quoted 3 lines
In the patch the FADT flag bit is checked to comply with the ACPI spec. But in order to use the ACPI reboot mechanism on some laptops, the DMI check table is added in which the FADT flag bit is ignored.
Understood. The problem is that it is very likely that Windows has NO DMI entry for these laptops, yet it still works. So if we can't figure out why these laptops work with Windows, we are setting ourselves up to create an unmaintainable DMI list, possibly including a very large number of systems which have this BIOS bug.
Quoted 4 lines
Of course what you said is also OK. When the system is expected to be rebooted using the ACPI reboot mechanism, the FADT flag bit is ignored and instead reset_register/reset_value is checked. If so, the DMI check table is redundant.
Redundant = deleted.
If we can figure out how/when to use the ACPI reset register w/o consulting the FADT bit, then there should be no DMI table.
thanks,
-Len
Quoted 8 lines · Len Brown
Quoted 5 lines
the default
reboot_typeisBOOT_KBD. So it is necessary to add the boot option of "reboot=a" to use the ACPI reboot mechanism.hmm,
arch/x86/kernel/reboot.chas this:
Quoted 7 lines
/*
* Keyboard reset and triple fault may result in INIT, not RESET, which
* doesn't work when we're in vmx root mode. Try ACPI first. */
enumreboot_typereboot_type=BOOT_ACPI;Am I mis-reading the code?
What you said is right. In the latest linus tree the default reboot_type is changed from KBD to ACPI.
Quoted 40 lines
Quoted 10 lines
Quoted 7 lines
Re: DMI to ignore a missing (acpi_gbl_FADT.flags &
ACPI_FADT_RESET_REGISTER)....If we need DMI,
it should be checked at _boot_ time, not at _reboot_ time, and the table should be marked_initdata.Ok. I will refresh it. The DMI table will be put into
_initdatasection.I'm okay with a DMI entry now, but only if we work on figuring out how to delete the DMI entries to fix the problem for all system w/o using DMI.
Quoted 9 lines
Quoted 5 lines
But the real question is if we should be checking this bit at all. The fact that we are adding DMI to ignore it suggest that we should think about ignoring it by default, and instead perhaps sanity checking acpi_gbl_FADT.reset_register and basing our decision to use it on that?
According to the ACPI spec the bit indicates whether the ACPI reset mechanism is supported. If it is zero, maybe OS should not use the ACPI reset mechanism even when
ACPI_RESET_REGis defined.understood.
Quoted 5 lines
On some laptops the system can't be rebooted by using default
reboot_type(BOOT_KBD)after it is resumed from S3. If the ACPI reboot is used, the system can be rebooted. But unfortunately the FADT flag bit indicates that ACPI reboot mechanism is not supported. This seems contradictory.This contradiction suggests that Windows is not following the ACPI spec, and is not checking the FADT bit before using the ACPI reboot mechanism.
Quoted 3 lines
In the patch the FADT flag bit is checked to comply with the ACPI spec. But in order to use the ACPI reboot mechanism on some laptops, the DMI check table is added in which the FADT flag bit is ignored.
Quoted 5 lines
Understood. The problem is that it is very likely that Windows has NO DMI entry for these laptops, yet it still works. So if we can't figure out why these laptops work with Windows, we are setting ourselves up to create an unmaintainable DMI list, possibly including a very large number of systems which have this BIOS bug.
Agree with what you said. Windows should have no such DMI entry for these laptops. But the problem is that we can't figure out that the laptops are rebooted by ACPI rebooting mechanism on windows. Maybe it is rebooted by other mechanism. If we can confirm that these laptops are rebooted by ACPI rebooting mechanism, it can be confirmed that the FADT flag bit is ingored when using the ACPI rebooting mechanism on windows. If so, the DMI table will be meaningless.On linux the FADT flag bit can also be ignored. When ACPI rebooting is used, it is enough only to check the RESET_REG address.
Quoted 13 lines
Quoted 4 lines
Of course what you said is also OK. When the system is expected to be rebooted using the ACPI reboot mechanism, the FADT flag bit is ignored and instead reset_register/reset_value is checked. If so, the DMI check table is redundant.
Redundant = deleted.
If we can figure out how/when to use the ACPI reset register w/o consulting the FADT bit, then there should be no DMI table.thanks,
-Len