Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/x86/acpi When we do the sanity check that a P- or T...
details: https://anonhg.NetBSD.org/src/rev/5a3cd73257e3
branches: trunk
changeset: 757258:5a3cd73257e3
user: jruoho <jruoho%NetBSD.org@localhost>
date: Sat Aug 21 15:37:35 2010 +0000
description:
When we do the sanity check that a P- or T-state transition was successful,
compare also against the control-field. There appears to be many BIOSes in
the field that report a zero value in the status-field. It is unclear whether
this should be taken as a hint that the status-check is not necessary also
during P-state transitions. If we still see timeouts (EAGAIN), this should
be reverted and the status-check should be bypassed if ps->ps_status is 0.
diffstat:
sys/arch/x86/acpi/acpi_cpu_md.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diffs (69 lines):
diff -r 8566f5abc280 -r 5a3cd73257e3 sys/arch/x86/acpi/acpi_cpu_md.c
--- a/sys/arch/x86/acpi/acpi_cpu_md.c Sat Aug 21 13:57:41 2010 +0000
+++ b/sys/arch/x86/acpi/acpi_cpu_md.c Sat Aug 21 15:37:35 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_md.c,v 1.27 2010/08/21 09:16:28 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_md.c,v 1.28 2010/08/21 15:37:35 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_md.c,v 1.27 2010/08/21 09:16:28 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.28 2010/08/21 15:37:35 jruoho Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -466,12 +466,12 @@
if (__predict_false(ps == NULL))
return ENODEV;
- if (ps->ps_status_addr == 0)
+ if (__predict_false(ps->ps_status_addr == 0))
return EINVAL;
val = rdmsr(ps->ps_status_addr);
- if (ps->ps_status_mask != 0)
+ if (__predict_true(ps->ps_status_mask != 0))
val = val & ps->ps_status_mask;
for (i = 0; i < sc->sc_pstate_count; i++) {
@@ -481,7 +481,7 @@
if (ps->ps_freq == 0)
continue;
- if (val == ps->ps_status) {
+ if (val == ps->ps_status || val == ps->ps_control) {
*freq = ps->ps_freq;
return 0;
}
@@ -535,7 +535,7 @@
if (__predict_true(ps->ps_status_mask != 0))
val = val & ps->ps_status_mask;
- if (val == ps->ps_status)
+ if (val == ps->ps_status || val == ps->ps_control)
return;
DELAY(ps->ps_latency);
@@ -560,7 +560,7 @@
if (ts->ts_percent == 0)
continue;
- if (val == ts->ts_control || val == ts->ts_status) {
+ if (val == ts->ts_status || val == ts->ts_control) {
*percent = ts->ts_percent;
return 0;
}
@@ -604,7 +604,7 @@
val = rdmsr(MSR_THERM_CONTROL);
- if (val == ts->ts_status)
+ if (val == ts->ts_status || val == ts->ts_control)
return;
DELAY(ts->ts_latency);
Home |
Main Index |
Thread Index |
Old Index