kern/121433: [cpufreq] kern_cpu.c's logic error leads to
spontaneous disabling of passive cooling
John Baldwin
jhb at FreeBSD.org
Fri May 2 20:20:06 UTC 2008
The following reply was made to PR kern/121433; it has been noted by GNATS.
From: John Baldwin <jhb at FreeBSD.org>
To: bug-followup at FreeBSD.org, eugen at kuzbass.ru
Cc:
Subject: Re: kern/121433: [cpufreq] kern_cpu.c's logic error leads to spontaneous disabling of passive cooling
Date: Fri, 2 May 2008 16:16:20 -0400
Try this patch:
Index: kern_cpu.c
===================================================================
RCS file: /usr/cvs/src/sys/kern/kern_cpu.c,v
retrieving revision 1.29
diff -u -r1.29 kern_cpu.c
--- kern_cpu.c 16 Jan 2008 01:05:21 -0000 1.29
+++ kern_cpu.c 2 May 2008 20:13:54 -0000
@@ -452,8 +452,7 @@
for (n = 0; n < numdevs && curr_set->freq == CPUFREQ_VAL_UNKNOWN; n++) {
if (!device_is_attached(devs[n]))
continue;
- error = CPUFREQ_DRV_GET(devs[n], &set);
- if (error)
+ if (CPUFREQ_DRV_GET(devs[n], &set) != 0)
continue;
for (i = 0; i < count; i++) {
if (CPUFREQ_CMP(set.freq, levels[i].total_set.freq)) {
@@ -483,9 +482,10 @@
if (CPUFREQ_CMP(rate, levels[i].total_set.freq)) {
sc->curr_level = levels[i];
CF_DEBUG("get estimated freq %d\n", curr_set->freq);
- break;
+ goto out;
}
}
+ error = ENXIO;
out:
if (error == 0)
--
John Baldwin
More information about the freebsd-bugs
mailing list