Skip to contentSkip to conversation

x86: Bypass legacy PIC and PIT in ACPI hardware reduced mode

PATCH New Li, Aubrey 2 participants 2 messages Mar 11, 2015 – Mar 16, 2015

Subsystems (2)
lore
Share & tools
lore

Li, Aubrey

author
#0 lore raw

PATCH v3 1/1 x86: Bypass legacy PIC and PIT in ACPI hardware reduced mode

On a platform in ACPI Hardware-reduced mode, the legacy PIC and PIT may not be initialized even though they may be present in silicon. Touching these legacy components causes unexpected results on the system.

On the Bay Trail-T(ASUS-T100) platform, touching these legacy components blocks platform hardware low idle power state(S0ix) during system suspend. So we should bypass them in ACPI hardware reduced mode.

---
 arch/x86/kernel/acpi/boot.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
arch/x86/kernel/acpi/boot.c +25 -0
index b9e30da..adb56cb 100644
@@ -1343,6 +1343,26 @@ static int __init dmi_ignore_irq0_timer_override(const struct dmi_system_id *d)
 }
 
 /*
+ * ACPI offers an alternative platform interface model that removes
+ * ACPI hardware requirements for platforms that do not implement
+ * the PC Architecture.
+ *
+ * We initialize the Hardware-reduced ACPI model here
+ */
+static void __init acpi_reduced_hw_init(void)
+{
+	if (acpi_gbl_reduced_hardware) {
+		/*
+		 * Override x86_init functions and bypass legacy pic
+		 * in Hardware-reduced ACPI mode
+		 */
+		x86_init.timers.timer_init	= x86_init_noop;
+		x86_init.irqs.pre_vector_init	= x86_init_noop;
+		legacy_pic			= &null_legacy_pic;
+	}
+}
+
+/*
  * If your system is blacklisted here, but you find that acpi=force
  * works for you, please contact [email protected]
  */
@@ -1541,6 +1561,11 @@ int __init early_acpi_boot_init(void)
 	 */
 	early_acpi_process_madt();
 
+	/*
+	 * Hardware-reduced ACPI mode initialization
+	 */
+	acpi_reduced_hw_init();
+
 	return 0;
 }
 
Signature · 1 line
1.9.1
#1 lore raw

[tip:x86/urgent] x86/platform, acpi: Bypass legacy PIC and PIT in ACPI hardware reduced mode

x86/platform, acpi: Bypass legacy PIC and PIT in ACPI hardware reduced mode
Commit-ID:  7486341a98f26857f383aec88ffa10950087c3a1
Gitweb:     http://git.kernel.org/tip/7486341a98f26857f383aec88ffa10950087c3a1
Author:     Li, Aubrey <[email protected]>
AuthorDate: Wed, 11 Mar 2015 16:09:00 +0800
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu, 12 Mar 2015 12:07:13 +0100

x86/platform, acpi: Bypass legacy PIC and PIT in ACPI hardware reduced mode

On a platform in ACPI Hardware-reduced mode, the legacy PIC and PIT may not be initialized even though they may be present in silicon. Touching these legacy components causes unexpected results on the system.

On the Bay Trail-T(ASUS-T100) platform, touching these legacy components blocks platform hardware low idle power state(S0ix) during system suspend. So we should bypass them in ACPI hardware reduced mode.

---
 arch/x86/kernel/acpi/boot.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
arch/x86/kernel/acpi/boot.c +25 -0
index 3d525c6..803b684 100644
@@ -1338,6 +1338,26 @@ static int __init dmi_ignore_irq0_timer_override(const struct dmi_system_id *d)
 }
 
 /*
+ * ACPI offers an alternative platform interface model that removes
+ * ACPI hardware requirements for platforms that do not implement
+ * the PC Architecture.
+ *
+ * We initialize the Hardware-reduced ACPI model here:
+ */
+static void __init acpi_reduced_hw_init(void)
+{
+	if (acpi_gbl_reduced_hardware) {
+		/*
+		 * Override x86_init functions and bypass legacy pic
+		 * in Hardware-reduced ACPI mode
+		 */
+		x86_init.timers.timer_init	= x86_init_noop;
+		x86_init.irqs.pre_vector_init	= x86_init_noop;
+		legacy_pic			= &null_legacy_pic;
+	}
+}
+
+/*
  * If your system is blacklisted here, but you find that acpi=force
  * works for you, please contact [email protected]
  */
@@ -1536,6 +1556,11 @@ int __init early_acpi_boot_init(void)
 	 */
 	early_acpi_process_madt();
 
+	/*
+	 * Hardware-reduced ACPI mode initialization:
+	 */
+	acpi_reduced_hw_init();
+
 	return 0;
 }