Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/acpi Lower the worst-case latency in P- and T-state ...
details: https://anonhg.NetBSD.org/src/rev/ab8801e9af73
branches: trunk
changeset: 762564:ab8801e9af73
user: jruoho <jruoho%NetBSD.org@localhost>
date: Wed Feb 23 06:17:55 2011 +0000
description:
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.
diffstat:
sys/dev/acpi/acpi_cpu_pstate.c | 24 ++++++++----------------
sys/dev/acpi/acpi_cpu_tstate.c | 6 +++---
2 files changed, 11 insertions(+), 19 deletions(-)
diffs (83 lines):
diff -r 1a1f01cbd012 -r ab8801e9af73 sys/dev/acpi/acpi_cpu_pstate.c
--- a/sys/dev/acpi/acpi_cpu_pstate.c Wed Feb 23 06:04:31 2011 +0000
+++ b/sys/dev/acpi/acpi_cpu_pstate.c Wed Feb 23 06:17:55 2011 +0000
@@ -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 <jruohonen%iki.fi@localhost>
@@ -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;
}
diff -r 1a1f01cbd012 -r ab8801e9af73 sys/dev/acpi/acpi_cpu_tstate.c
--- a/sys/dev/acpi/acpi_cpu_tstate.c Wed Feb 23 06:04:31 2011 +0000
+++ b/sys/dev/acpi/acpi_cpu_tstate.c Wed Feb 23 06:17:55 2011 +0000
@@ -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 <jruohonen%iki.fi@localhost>
@@ -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;
Home |
Main Index |
Thread Index |
Old Index