Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Dec 2005 20:09:57 GMT
From:      Christian Wittenhorst <wiwi@progon.net>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/90903: cpufreq inconsistency / powerd broken
Message-ID:  <200512252009.jBPK9vuA090941@www.freebsd.org>
Resent-Message-ID: <200512252020.jBPKKApB060424@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         90903
>Category:       kern
>Synopsis:       cpufreq inconsistency / powerd broken
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Dec 25 20:20:10 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Christian Wittenhorst
>Release:        6.0p1
>Organization:
progon network engineering
>Environment:
FreeBSD ns-a.kanti-zug.ch 6.0-RELEASE-p1 FreeBSD 6.0-RELEASE-p1 #0: Sun Dec 25 16:55:09 UTC 2005     root@ns-a.kanti-zug.ch:/usr/src/sys/i386/compile/services-a  i386              
>Description:
one some platforms, dev.cpu.0.freq does not match any value from dev.cpu.0.freq_levels. This brakes powerd. 

sysctl -a:
dev.cpu.0.freq: 2798
dev.cpu.0.freq_levels: 2795/-1 2445/-1 2139/-1 2096/-1 1834/-1 1746/-1 1572/-1 1527/-1 1397/-1 1309/-1 1222/-1 1091/-1 1048/-1 917/-1 873/-1 786/-1 698/-1 655/-1 610/-1 523/-1 436/-1 349/-1 305/-1 261/-1 218/-1 174/-1 130/-1 87/-1 43/-1
dev.acpi_throttle.0.freq_settings: 10000/-1 8750/-1 7500/-1 6250/-1 5000/-1 3750/-1 2500/-1 1250/-1
dev.cpufreq.0.%driver: cpufreq
dev.cpufreq.0.%parent: cpu0

The reason why powerd fails is:

src/usr.sbin/powerd/powerd.c:
[...]
if (vflag) {
   for (i = 0; i < numfreqs; i++) {
      if (freqs[i] == curfreq)
         break;
   }
[...]

                        }

>How-To-Repeat:
              
>Fix:
quick and dirty fix:

src/usr.sbin/powerd/powerd.c:

[...]
if (vflag) {
   for (i = 0; i < numfreqs; i++) {
      if (freqs[i] == curfreq)
         break;
   }
***
   if (i==numfreqs) {
      i=0;
   }
***
>Release-Note:
>Audit-Trail:
>Unformatted:



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