From nobody@FreeBSD.org  Tue Mar 11 08:01:37 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6AA171065672
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 11 Mar 2008 08:01:37 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 4A7668FC1D
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 11 Mar 2008 08:01:37 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m2B7wNtn068356
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 11 Mar 2008 07:58:23 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m2B7wNTh068355;
	Tue, 11 Mar 2008 07:58:23 GMT
	(envelope-from nobody)
Message-Id: <200803110758.m2B7wNTh068355@www.freebsd.org>
Date: Tue, 11 Mar 2008 07:58:23 GMT
From: kevin <kevinxlinuz@163.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: powerd may not work correctly
X-Send-Pr-Version: www-3.1
X-GNATS-Notify: mwm-keyword-freebsd.17a675@mired.org

>Number:         121590
>Category:       amd64
>Synopsis:       [est] [p4tcc] [acpi_perf] setting dev.cpu.0.freq sometimes gives "Invalid argument"
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-amd64
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 11 08:10:01 UTC 2008
>Closed-Date:    Wed Sep 01 13:12:56 UTC 2010
>Last-Modified:  Wed Sep 01 13:12:56 UTC 2010
>Originator:     kevin
>Release:        freebsd 7 release
>Organization:
163
>Environment:
FreeBSD xxx-laptop.people.163.org 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Mon Mar 10 19:53:14 CST 2008     root@xxx-laptop.people.163.org:/usr/obj/usr/src/sys/G7laptop  amd64

>Description:
powerd many not work correctly on intel T7700 cpu.
#powerd -v
powerd: using sysctl for AC line status
powerd: using devd for AC line status
idle time < 65%, increasing clock speed from 297 MHz to 893 MHz
powerd: error setting CPU frequency 893: Invalid argument
idle time < 65%, increasing clock speed from 1488 MHz to 2084 MHz
idle time > 90%, decreasing clock speed from 2382 MHz to 2084 MHz
idle time > 90%, decreasing clock speed from 1786 MHz to 1488 MHz
powerd: error setting CPU frequency 1488: Invalid argument
idle time > 90%, decreasing clock speed from 1191 MHz to 893 MHz
powerd: error setting CPU frequency 893: Invalid argument
idle time < 65%, increasing clock speed from 595 MHz to 1191 MHz
powerd: error setting CPU frequency 1191: Invalid argument
idle time < 65%, increasing clock speed from 1786 MHz to 2382 MHz
powerd: error setting CPU frequency 2382: Invalid argument
idle time > 90%, decreasing clock speed from 2382 MHz to 2084 MHz
idle time > 90%, decreasing clock speed from 1786 MHz to 1488 MHz
powerd: error setting CPU frequency 1488: Invalid argument
idle time > 90%, decreasing clock speed from 1191 MHz to 893 MHz
powerd: error setting CPU frequency 893: Invalid argument
idle time > 90%, decreasing clock speed from 595 MHz to 297 MHz
powerd: error setting CPU frequency 297: Invalid argument

>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:

From: John Baldwin <jhb@freebsd.org>
To: freebsd-amd64@freebsd.org
Cc: kevin <kevinxlinuz@163.com>,
 freebsd-gnats-submit@freebsd.org
Subject: Re: amd64/121590: powerd may not work correctly
Date: Tue, 11 Mar 2008 08:47:47 -0400

 This has more to do with your cpufreq drivers than with powerd.  Can you 
 provide the dmesg lines for your CPU and its cpufreq drivers as well as the 
 output of 'sysctl dev.cpu'?
 
 -- 
 John Baldwin
State-Changed-From-To: open->feedback 
State-Changed-By: linimon 
State-Changed-When: Tue Mar 11 14:57:22 UTC 2008 
State-Changed-Why:  
Note that submitter has been asked for feedback. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=121590 

From: mwm-keyword-freebsd.17a675@mired.org
To: bug-followup@FreeBSD.org, kevinxlinuz@163.com
Cc:  
Subject: Re: amd64/121590: powerd(8) may not work correctly
Date: 8 May 2008 19:02:41 -0400

 I have the same problem, so I'm hoping that my answering the question
 will help prevent this from being closed due to lack of feedback.
 
 CPU: Intel(R) Core(TM)2 Quad CPU    Q6600  @ 2.40GHz (2402.42-MHz K8-class CPU)
   Origin = "GenuineIntel"  Id = 0x6fb  Stepping = 11
   Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
   Features2=0xe3bd<SSE3,RSVD2,MON,DS_CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM>
   AMD Features=0x20100800<SYSCALL,NX,LM>
   AMD Features2=0x1<LAHF>
   Cores per package: 4
 
 cpu0: <ACPI CPU> on acpi0
 acpi_perf0: <ACPI CPU Frequency Control> on cpu0
 p4tcc0: <CPU Frequency Thermal Control> on cpu0
 cpu1: <ACPI CPU> on acpi0
 est1: <Enhanced SpeedStep Frequency Control> on cpu1
 est: cpu_vendor GenuineIntel, msr 927092706000927
 p4tcc1: <CPU Frequency Thermal Control> on cpu1
 cpu2: <ACPI CPU> on acpi0
 est2: <Enhanced SpeedStep Frequency Control> on cpu2
 est: cpu_vendor GenuineIntel, msr 927092706000927
 p4tcc2: <CPU Frequency Thermal Control> on cpu2
 cpu3: <ACPI CPU> on acpi0
 est3: <Enhanced SpeedStep Frequency Control> on cpu3
 est: cpu_vendor GenuineIntel, msr 927092706000927
 p4tcc3: <CPU Frequency Thermal Control> on cpu3
 
 
 What's interesting is that it actually seems to work. The value from
 dev.cpu.0.freq changes as powerd runs.
 
 Finally, it's easy to show that it's not powerd. I can take it out of
 the equation:
 
 bhuda# sysctl dev.cpu.0.freq
 dev.cpu.0.freq: 2400
 bhuda# sysctl dev.cpu.0.freq=200
 dev.cpu.0.freq: 2400
 sysctl: dev.cpu.0.freq: Invalid argument
 bhuda# sysctl dev.cpu.0.freq
 dev.cpu.0.freq: 200
 bhuda# sysctl dev.cpu.0.freq=2400
 dev.cpu.0.freq: 200
 sysctl: dev.cpu.0.freq: Invalid argument
 bhuda# sysctl dev.cpu.0.freq
 dev.cpu.0.freq: 2400
 
 And, as you can see, it sure looks like it actually works.
State-Changed-From-To: feedback->open 
State-Changed-By: gavin 
State-Changed-When: Wed Aug 6 14:01:28 UTC 2008 
State-Changed-Why:  
Feedback was received 

http://www.freebsd.org/cgi/query-pr.cgi?pr=121590 
State-Changed-From-To: open->feedback 
State-Changed-By: gavin 
State-Changed-When: Wed Aug 6 14:03:07 UTC 2008 
State-Changed-Why:  
My mistake, some feedback was received, but we still need the output of 
"sysctl dev.cpu" along with the rest of the information before we can 
figure out where the problem lies 

http://www.freebsd.org/cgi/query-pr.cgi?pr=121590 
State-Changed-From-To: feedback->open 
State-Changed-By: gavin 
State-Changed-When: Fri Aug 8 11:14:23 UTC 2008 
State-Changed-Why:  
Feedback was received from Mike Meyer: 

dev.cpu.0.%desc: ACPI CPU 
dev.cpu.0.%driver: cpu 
dev.cpu.0.%location: handle=_PR_.CPU0 
dev.cpu.0.%pnpinfo: _HID=none _UID=0 
dev.cpu.0.%parent: acpi0 
dev.cpu.0.freq: 800 
dev.cpu.0.freq_levels: 2400/88000 2100/77000 1800/66000 1600/57000 1400/49875 1200/42750 1000/35625 800/28500 600/21375 400/14250 200/7125 
dev.cpu.0.temperature: 59 
dev.cpu.0.cx_supported: C1/0 
dev.cpu.0.cx_lowest: C1 
dev.cpu.0.cx_usage: 100.00% 
dev.cpu.1.%desc: ACPI CPU 
dev.cpu.1.%driver: cpu 
dev.cpu.1.%location: handle=_PR_.CPU1 
dev.cpu.1.%pnpinfo: _HID=none _UID=0 
dev.cpu.1.%parent: acpi0 
dev.cpu.1.temperature: 58 
dev.cpu.1.cx_supported: C1/0 
dev.cpu.1.cx_lowest: C1 
dev.cpu.1.cx_usage: 100.00% 
dev.cpu.2.%desc: ACPI CPU 
dev.cpu.2.%driver: cpu 
dev.cpu.2.%location: handle=_PR_.CPU2 
dev.cpu.2.%pnpinfo: _HID=none _UID=0 
dev.cpu.2.%parent: acpi0 
dev.cpu.2.temperature: 50 
dev.cpu.2.cx_supported: C1/0 
dev.cpu.2.cx_lowest: C1 
dev.cpu.2.cx_usage: 100.00% 
dev.cpu.3.%desc: ACPI CPU 
dev.cpu.3.%driver: cpu 
dev.cpu.3.%location: handle=_PR_.CPU3 
dev.cpu.3.%pnpinfo: _HID=none _UID=0 
dev.cpu.3.%parent: acpi0 
dev.cpu.3.temperature: 52 
dev.cpu.3.cx_supported: C1/0 
dev.cpu.3.cx_lowest: C1 
dev.cpu.3.cx_usage: 100.00% 


http://www.freebsd.org/cgi/query-pr.cgi?pr=121590 

From: Mike Meyer <mwm@mired.org>
To: Gavin Atkinson <gavin@FreeBSD.org>
Cc: bug-followup@FreeBSD.org
Subject: Re: amd64/121590: powerd(8) may not work correctly
Date: Fri, 8 Aug 2008 12:15:06 -0400

 On Fri, 08 Aug 2008 12:21:26 +0100
 Gavin Atkinson <gavin@FreeBSD.org> wrote:
 
 > On Wed, 2008-08-06 at 18:50 -0400, Mike Meyer wrote:
 > > Here's the sysctl dev.cpu output you requested.
 > 
 > Thanks for that.  The symptoms you were seeing was that
 > "sysctl dev.cpu.0.freq=200" would return "Invalid argument" but yet
 > appear to actually set the frequency.  Are you able to confirm that the
 > CPU speed has actually dropped (e.g. by timing a compile, or similar)?
 > It's not clear from your info whether the CPU frequency is actually
 > changing, or if it's just the sysctl value that is changing.
 > 
 > Please CC your response to bug-followup@FreeBSD.org so that it ends up
 > in the PR audit trail.
 
 I don't believe the cpu speed is actually changing:
 
 
 bhuda# sysctl dev.cpu.0.freq
 dev.cpu.0.freq: 200
 bhuda# dhry
 Dhrystone(1.1) time for 500000000 passes = 171.9
 This machine benchmarks at 2908712 dhrystones/second
 bhuda# sysctl dev.cpu.0.freq=2400
 dev.cpu.0.freq: 200
 sysctl: dev.cpu.0.freq: Invalid argument
 bhuda# sysctl dev.cpu.0.freq
 dev.cpu.0.freq: 2400
 bhuda# dhry
 Dhrystone(1.1) time for 500000000 passes = 165.4
 This machine benchmarks at 3022085 dhrystones/second
 
      <mike
 -- 
 Mike Meyer <mwm@mired.org>		http://www.mired.org/consulting.html
 Independent Network/Unix/Perforce consultant, email for more information.
 
 O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
State-Changed-From-To: open->feedback 
State-Changed-By: mav 
State-Changed-When: Sat Nov 14 17:03:03 UTC 2009 
State-Changed-Why:  
Try to check it on newer OS. I think it could be fixed by 
r186154, merged to 7.2-STABLE. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=121590 
State-Changed-From-To: feedback->closed 
State-Changed-By: jh 
State-Changed-When: Wed Sep 1 13:12:55 UTC 2010 
State-Changed-Why:  
Feedback timeout. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=121590 
>Unformatted:
