Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 May 2008 20:20:06 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/121433: [cpufreq] kern_cpu.c's logic error leads to spontaneous disabling of passive cooling
Message-ID:  <200805022020.m42KK6tE007100@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/121433; it has been noted by GNATS.

From: John Baldwin <jhb@FreeBSD.org>
To: bug-followup@FreeBSD.org, eugen@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200805022020.m42KK6tE007100>