Module Name:    src
Committed By:   ad
Date:           Sat Mar 14 13:50:46 UTC 2020

Modified Files:
        src/sys/arch/x86/acpi: acpi_cpu_md.c

Log Message:
Put ACPI idle under ACPICPU_ENABLE_C3 until the wrinkles are ironed out.
This seems well written and basically all good, but currently doesn't enter
a low power state, and imposes a big performance penalty.  Proposed on
port-i386 & port-amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/x86/acpi/acpi_cpu_md.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/acpi/acpi_cpu_md.c
diff -u src/sys/arch/x86/acpi/acpi_cpu_md.c:1.81 src/sys/arch/x86/acpi/acpi_cpu_md.c:1.82
--- src/sys/arch/x86/acpi/acpi_cpu_md.c:1.81	Tue Nov  5 20:21:34 2019
+++ src/sys/arch/x86/acpi/acpi_cpu_md.c	Sat Mar 14 13:50:46 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_md.c,v 1.81 2019/11/05 20:21:34 maxv Exp $ */
+/* $NetBSD: acpi_cpu_md.c,v 1.82 2020/03/14 13:50:46 ad Exp $ */
 
 /*-
  * Copyright (c) 2010, 2011 Jukka Ruohonen <jruoho...@iki.fi>
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.81 2019/11/05 20:21:34 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.82 2020/03/14 13:50:46 ad Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -103,8 +103,10 @@ __KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.
 
 #define FID_TO_VCO_FID(fidd)	(((fid) < 8) ? (8 + ((fid) << 1)) : (fid))
 
+#ifdef ACPICPU_ENABLE_C3
 static char	  native_idle_text[16];
 void		(*native_idle)(void) = NULL;
+#endif
 
 static int	 acpicpu_md_quirk_piix4(const struct pci_attach_args *);
 static void	 acpicpu_md_pstate_hwf_reset(void *, void *);
@@ -348,6 +350,12 @@ acpicpu_md_quirk_c1e(void)
 int
 acpicpu_md_cstate_start(struct acpicpu_softc *sc)
 {
+#ifdef ACPICPU_ENABLE_C3
+	/*
+	 * XXX There are performance problems with the ACPI idle loop, and
+	 * it does not enter deep sleep.  Once those are resolved it'll be
+	 * re-enabled.
+	 */
 	const size_t size = sizeof(native_idle_text);
 	struct acpicpu_cstate *cs;
 	bool ipi = false;
@@ -369,6 +377,7 @@ acpicpu_md_cstate_start(struct acpicpu_s
 	}
 
 	x86_cpu_idle_set(acpicpu_cstate_idle, "acpi", ipi);
+#endif	/* ACPICPU_ENABLE_C3 */
 
 	return 0;
 }
@@ -376,6 +385,12 @@ acpicpu_md_cstate_start(struct acpicpu_s
 int
 acpicpu_md_cstate_stop(void)
 {
+#ifdef ACPICPU_ENABLE_C3
+	/*
+	 * XXX There are performance problems with the ACPI idle loop, and
+	 * it does not enter deep sleep.  Once those are resolved it'll be
+	 * re-enabled.
+	 */
 	static char text[16];
 	void (*func)(void);
 	bool ipi;
@@ -393,6 +408,7 @@ acpicpu_md_cstate_stop(void)
 	 * out from the ACPI idle-loop before detachment.
 	 */
 	xc_barrier(0);
+#endif	/* ACPICPU_ENABLE_C3 */
 
 	return 0;
 }

Reply via email to