[PATCH]: Add the DMI check table to support ACPI reboot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Subject: ACPI: Add the DMI check table to support ACPI reboot
From: Zhao Yakui <yakui.zhao@xxxxxxxxx>

On some laptops the system can't be rebooted after it is resumed from
S3. The system can be rebooted by writing 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

Signed-off-by: Zhao Yakui <yakui.zhao@xxxxxxxxx>
---
 drivers/acpi/reboot.c |   25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

Index: linux-2.6/drivers/acpi/reboot.c
===================================================================
--- linux-2.6.orig/drivers/acpi/reboot.c
+++ linux-2.6/drivers/acpi/reboot.c
@@ -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;
 


--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux