Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8fd14591 authored by Zhao Yakui's avatar Zhao Yakui Committed by Len Brown
Browse files

ACPI: Ingore the RESET_REG_SUP bit when using ACPI reset mechanism

According to ACPI 3.0, FADT.flags.RESET_REG_SUP indicates
whether the ACPI reboot mechanism is supported.

However, some boxes have this bit clear, have a valid
ACPI_RESET_REG & RESET_VALUE, and ACPI reboot is the only
mechanism that works for them after S3.

This suggests that other operating systems may not be checking
the RESET_REG_SUP bit, and are using other means to decide
whether to use the ACPI reboot mechanism or not.

Here we stop checking RESET_REG_SUP.
Instead, When acpi reboot is requested,
only the reset_register is checked. If the following
conditions are met, it indicates that the reset register is supported.
	a. reset_register is not zero
	b. the access width is eight
	c. the bit_offset is zero

http://bugzilla.kernel.org/show_bug.cgi?id=7299
http://bugzilla.kernel.org/show_bug.cgi?id=1148



Signed-off-by: default avatarZhao Yakui <yakui.zhao@intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 3fa8749e
Loading
Loading
Loading
Loading
+22 −3
Original line number Original line Diff line number Diff line
@@ -15,9 +15,28 @@ void acpi_reboot(void)


	rr = &acpi_gbl_FADT.reset_register;
	rr = &acpi_gbl_FADT.reset_register;


	/* Is the reset register supported? */
	/*
	if (!(acpi_gbl_FADT.flags & ACPI_FADT_RESET_REGISTER) ||
	 * Is the ACPI reset register supported?
	    rr->bit_width != 8 || rr->bit_offset != 0)
	 *
	 * According to ACPI 3.0, FADT.flags.RESET_REG_SUP indicates
	 * whether the ACPI reset mechanism is supported.
	 *
	 * However, some boxes have this bit clear, yet a valid
	 * ACPI_RESET_REG & RESET_VALUE, and ACPI reboot is the only
	 * mechanism that works for them after S3.
	 *
	 * This suggests that other operating systems may not be checking
	 * the RESET_REG_SUP bit, and are using other means to decide
	 * whether to use the ACPI reboot mechanism or not.
	 *
	 * So when acpi reboot is requested,
	 * only the reset_register is checked. If the following
	 * conditions are met, it indicates that the reset register is supported.
	 * 	a. reset_register is not zero
	 * 	b. the access width is eight
	 * 	c. the bit_offset is zero
	 */
	if (!(rr->address) || rr->bit_width != 8 || rr->bit_offset != 0)
		return;
		return;


	reset_value = acpi_gbl_FADT.reset_value;
	reset_value = acpi_gbl_FADT.reset_value;