Module Name: src
Committed By: jruoho
Date: Wed Feb 23 06:17:55 UTC 2011
Modified Files:
src/sys/dev/acpi: acpi_cpu_pstate.c acpi_cpu_tstate.c
Log Message:
Lower the worst-case latency in P- and T-state transitions to 1 usec.
The previous 10 usec was based on the Intel's Core family. It may have been
improved since that. Also provide an arbitrary upper bound for BIOS bugs.
To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/acpi/acpi_cpu_pstate.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/acpi/acpi_cpu_tstate.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/dev/acpi/acpi_cpu_pstate.c
diff -u src/sys/dev/acpi/acpi_cpu_pstate.c:1.37 src/sys/dev/acpi/acpi_cpu_pstate.c:1.38
--- src/sys/dev/acpi/acpi_cpu_pstate.c:1.37 Sun Jan 30 08:55:52 2011
+++ src/sys/dev/acpi/acpi_cpu_pstate.c Wed Feb 23 06:17:55 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_pstate.c,v 1.37 2011/01/30 08:55:52 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_pstate.c,v 1.38 2011/02/23 06:17:55 jruoho Exp $ */
/*-
* Copyright (c) 2010 Jukka Ruohonen <[email protected]>
@@ -27,7 +27,7 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_pstate.c,v 1.37 2011/01/30 08:55:52 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_pstate.c,v 1.38 2011/02/23 06:17:55 jruoho Exp $");
#include <sys/param.h>
#include <sys/evcnt.h>
@@ -480,12 +480,8 @@
if (ps->ps_freq == 0 || ps->ps_freq > 9999)
return AE_BAD_DECIMAL_CONSTANT;
- /*
- * The latency is typically around 10 usec
- * on Intel CPUs. Use that as the minimum.
- */
- if (ps->ps_latency < 10)
- ps->ps_latency = 10;
+ if (ps->ps_latency == 0 || ps->ps_latency > 1000)
+ ps->ps_latency = 1;
return AE_OK;
}
@@ -595,18 +591,14 @@
if (ps->ps_status_mask == 0)
ps->ps_status_mask = ACPI_GET64(elm[7].Buffer.Pointer);
- /*
- * The latency is often defined to be
- * zero on AMD systems. Raise that to 1.
- */
- if (ps->ps_latency == 0)
- ps->ps_latency = 1;
-
ps->ps_flags |= ACPICPU_FLAG_P_XPSS;
- if (ps->ps_freq > 9999)
+ if (ps->ps_freq == 0 || ps->ps_freq > 9999)
return AE_BAD_DECIMAL_CONSTANT;
+ if (ps->ps_latency == 0 || ps->ps_latency > 1000)
+ ps->ps_latency = 1;
+
return AE_OK;
}
Index: src/sys/dev/acpi/acpi_cpu_tstate.c
diff -u src/sys/dev/acpi/acpi_cpu_tstate.c:1.20 src/sys/dev/acpi/acpi_cpu_tstate.c:1.21
--- src/sys/dev/acpi/acpi_cpu_tstate.c:1.20 Fri Feb 18 07:00:05 2011
+++ src/sys/dev/acpi/acpi_cpu_tstate.c Wed Feb 23 06:17:55 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_tstate.c,v 1.20 2011/02/18 07:00:05 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_tstate.c,v 1.21 2011/02/23 06:17:55 jruoho Exp $ */
/*-
* Copyright (c) 2010 Jukka Ruohonen <[email protected]>
@@ -27,7 +27,7 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_tstate.c,v 1.20 2011/02/18 07:00:05 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_tstate.c,v 1.21 2011/02/23 06:17:55 jruoho Exp $");
#include <sys/param.h>
#include <sys/evcnt.h>
@@ -400,7 +400,7 @@
if (ts->ts_percent < 10 || ts->ts_percent > 100)
return AE_BAD_DECIMAL_CONSTANT;
- if (ts->ts_latency < 1)
+ if (ts->ts_latency == 0 || ts->ts_latency > 1000)
ts->ts_latency = 1;
return AE_OK;