summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2014-05-10 18:59:30 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2014-05-10 18:59:30 +0000
commit4a36eaa141a2b4136b3b868ce88fb804691ee90d (patch)
treee13f426fce2b87e104cdf9e36fdade54eba18fb1
parent54047f487f5865f9b9a56fca7a82ac1f4bff8990 (diff)
Disable speedstep instead of panicing if the high and low speeds are the same.
Problem noted by Benjamin Baier (programmer (at) netzbasis.de) improvements and ok kettenis@
-rw-r--r--sys/arch/amd64/amd64/est.c9
-rw-r--r--sys/arch/i386/i386/est.c9
2 files changed, 12 insertions, 6 deletions
diff --git a/sys/arch/amd64/amd64/est.c b/sys/arch/amd64/amd64/est.c
index 3059a0698d6..d4ad12e6ed8 100644
--- a/sys/arch/amd64/amd64/est.c
+++ b/sys/arch/amd64/amd64/est.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: est.c,v 1.30 2014/03/16 05:19:44 jsg Exp $ */
+/* $OpenBSD: est.c,v 1.31 2014/05/10 18:59:29 guenther Exp $ */
/*
* Copyright (c) 2003 Michael Eriksson.
* All rights reserved.
@@ -420,12 +420,15 @@ est_init(struct cpu_info *ci)
if (est_fqlist->n < 2)
return;
- printf("%s: Enhanced SpeedStep %d MHz", cpu_device, cpuspeed);
-
low = est_fqlist->table[est_fqlist->n - 1].mhz;
high = est_fqlist->table[0].mhz;
+ if (low == high)
+ return;
+
perflevel = (cpuspeed - low) * 100 / (high - low);
+ printf("%s: Enhanced SpeedStep %d MHz", cpu_device, cpuspeed);
+
/*
* OK, tell the user the available frequencies.
*/
diff --git a/sys/arch/i386/i386/est.c b/sys/arch/i386/i386/est.c
index 5f3a72369bc..dc159fc625e 100644
--- a/sys/arch/i386/i386/est.c
+++ b/sys/arch/i386/i386/est.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: est.c,v 1.40 2012/10/08 09:01:21 jsg Exp $ */
+/* $OpenBSD: est.c,v 1.41 2014/05/10 18:59:29 guenther Exp $ */
/*
* Copyright (c) 2003 Michael Eriksson.
* All rights reserved.
@@ -1179,12 +1179,15 @@ est_init(struct cpu_info *ci, int vendor)
if (est_fqlist->n < 2)
return;
- printf("%s: Enhanced SpeedStep %d MHz", cpu_device, cpuspeed);
-
low = est_fqlist->table[est_fqlist->n - 1].mhz;
high = est_fqlist->table[0].mhz;
+ if (low == high)
+ return;
+
perflevel = (cpuspeed - low) * 100 / (high - low);
+ printf("%s: Enhanced SpeedStep %d MHz", cpu_device, cpuspeed);
+
/*
* OK, tell the user the available frequencies.
*/