# AMD FX, powerd, hwpstate



## vans9 (Apr 18, 2012)

Hi.

I've got AMD FX-4100, ASUS M5A97 with the AMD 970, FreeBSD 9.0-RELEASE amd64 GENERIC.

I've got

```
hint.acpi_throttle.0.disabled="1"
debug.hwpstate_verbose="1"
```
to eliminate acpi_throttle issues.

If I try to enable powerd (via rc.conf) I get:


```
Copyright (c) 1992-2012 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
	The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 9.0-RELEASE #0: Tue Jan  3 07:46:30 UTC 2012
    root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64
CPU: AMD FX(tm)-4100 Quad-Core Processor             (3612.16-MHz K8-class CPU)
  Origin = "AuthenticAMD"  Id = 0x600f12  Family = 15  Model = 1  Stepping = 2
  Features=0x178bfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT>
  Features2=0x1698220b<SSE3,PCLMULQDQ,MON,SSSE3,CX16,SSE4.1,SSE4.2,POPCNT,AESNI,XSAVE,AVX>
  AMD Features=0x2e500800<SYSCALL,NX,MMX+,FFXSR,Page1GB,RDTSCP,LM>
  AMD Features2=0x1c9bfff<LAHF,CMP,SVM,ExtAPIC,CR8,ABM,SSE4A,MAS,Prefetch,OSVW,IBS,XOP,SKINIT,WDT,LWP,FMA4,NodeId,Topology,<b23>,<b24>>
  TSC: P-state invariant, performance statistics
real memory  = 8589934592 (8192 MB)
avail memory = 8158220288 (7780 MB)
Event timer "LAPIC" quality 400
ACPI APIC Table: <ALASKA A M I>
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
FreeBSD/SMP: 1 package(s) x 4 core(s)
 cpu0 (BSP): APIC ID: 16
 cpu1 (AP): APIC ID: 17
 cpu2 (AP): APIC ID: 18
 cpu3 (AP): APIC ID: 19
ACPI Warning: Optional field Pm2ControlBlock has zero address or length: 0x0000000000000000/0x1 (20110527/tbfadt-586)
ioapic0 <Version 2.1> irqs 0-23 on motherboard
ioapic1 <Version 2.1> irqs 24-55 on motherboard
kbd1 at kbdmux0
cryptosoft0: <software crypto> on motherboard
aesni0: <AES-CBC,AES-XTS> on motherboard
acpi0: <ALASKA A M I> on motherboard
ACPI Error: [RAMB] Namespace lookup failure, AE_NOT_FOUND (20110527/psargs-392)
ACPI Exception: AE_NOT_FOUND, Could not execute arguments for [RAMW] (Region) (20110527/nsinit-380)
acpi0: Power Button (fixed)
Timecounter "ACPI-safe" frequency 3579545 Hz quality 850
acpi_timer0: <32-bit timer at 3.579545MHz> port 0x808-0x80b on acpi0
cpu0: <ACPI CPU> on acpi0
cpu1: <ACPI CPU> on acpi0
cpu2: <ACPI CPU> on acpi0
cpu3: <ACPI CPU> on acpi0
acpi_ec0: <Embedded Controller: GPE 0xa> port 0x62,0x66 on acpi0
hpet0: <High Precision Event Timer> iomem 0xfed00000-0xfed003ff on acpi0
Timecounter "HPET" frequency 14318180 Hz quality 950
Event timer "HPET" frequency 14318180 Hz quality 450
Event timer "HPET1" frequency 14318180 Hz quality 450
Event timer "HPET2" frequency 14318180 Hz quality 450
...
attimer0: <AT timer> port 0x40-0x43 irq 0 on acpi0
Timecounter "i8254" frequency 1193182 Hz quality 0
Event timer "i8254" frequency 1193182 Hz quality 100
atrtc0: <AT realtime clock> port 0x70-0x71 irq 8 on acpi0
Event timer "RTC" frequency 32768 Hz quality 0
atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
ppc0: cannot reserve I/O port range
hwpstate0: going to fetch info from acpi_perf
hwpstate0: <Cool`n'Quiet 2.0> on cpu0
Timecounters tick every 1.000 msec
...
Configuring syscons: keymap blanktime.
Starting cron.
Starting inetd.

...
hwpstate0: setting P1-state on cpu0
hwpstate0: result  P0-state on cpu0
hwpstate0: error: loop is not enough.
hwpstate0: setting P1-state on cpu1
hwpstate0: result  P1-state on cpu1
hwpstate0: setting P1-state on cpu2
hwpstate0: result  P1-state on cpu2
hwpstate0: setting P1-state on cpu3
hwpstate0: result  P1-state on cpu3
hwpstate0: set freq failed, err 6
hwpstate0: setting P1-state on cpu0
hwpstate0: result  P1-state on cpu0
hwpstate0: setting P1-state on cpu1
hwpstate0: result  P1-state on cpu1
hwpstate0: setting P1-state on cpu2
hwpstate0: result  P1-state on cpu2
hwpstate0: setting P1-state on cpu3
hwpstate0: result  P1-state on cpu3
hwpstate0: setting P2-state on cpu0
hwpstate0: result  P1-state on cpu0
hwpstate0: error: loop is not enough.
hwpstate0: setting P2-state on cpu1
hwpstate0: result  P2-state on cpu1
hwpstate0: setting P2-state on cpu2
hwpstate0: result  P2-state on cpu2
hwpstate0: setting P2-state on cpu3
hwpstate0: result  P2-state on cpu3
hwpstate0: set freq failed, err 6
hwpstate0: setting P2-state on cpu0
hwpstate0: result  P2-state on cpu0
hwpstate0: setting P2-state on cpu1
hwpstate0: result  P2-state on cpu1
hwpstate0: setting P2-state on cpu2
hwpstate0: result  P2-state on cpu2
hwpstate0: setting P2-state on cpu3
hwpstate0: result  P2-state on cpu3
hwpstate0: setting P0-state on cpu0
hwpstate0: result  P0-state on cpu0
hwpstate0: setting P0-state on cpu1
hwpstate0: result  P0-state on cpu1
hwpstate0: setting P0-state on cpu2
hwpstate0: result  P0-state on cpu2
hwpstate0: setting P0-state on cpu3
hwpstate0: result  P0-state on cpu3
```

Or if I launch powerd in console:

```
sf1# powerd -v -n hadp
powerd: unable to determine AC line status
load  76%, current freq 3600 MHz ( 0), wanted freq 7200 MHz
load  32%, current freq 3600 MHz ( 0), wanted freq 7200 MHz
load  43%, current freq 3600 MHz ( 0), wanted freq 7200 MHz
load  38%, current freq 3600 MHz ( 0), wanted freq 7200 MHz
load  39%, current freq 3600 MHz ( 0), wanted freq 7200 MHz
load  39%, current freq 3600 MHz ( 0), wanted freq 7200 MHz
load  37%, current freq 3600 MHz ( 0), wanted freq 7200 MHz
load  20%, current freq 3600 MHz ( 0), wanted freq 6975 MHz
load  63%, current freq 3600 MHz ( 0), wanted freq 7200 MHz
^Ctotal joules used: 47.205
```

So, my question is: is it a hardware issue (and possibly I have to turn on/off something in BIOS), or do I have to tune something here, in FreeBSD?


----------



## mav@ (Apr 20, 2012)

Sorry, what issue exactly are you talking about?


----------



## vans9 (Apr 21, 2012)

I mean that the frequency couldn't be set.


----------



## vans9 (Apr 21, 2012)

Also if *I* try setting the frequency via sysctl, I get an error too.


----------



## cydnub (May 16, 2012)

I too am apparently having the same issue, new freebsd FreeBSD 9 release install, AMD Opteron 6212, Supermicro H8SGL-F board. Same error:


```
hwpstate0: set freq failed err 6
```

and I too have in my loader.conf


```
hint.acpi_throttle.0.disabled="1"
```

which has been said to be a workaround, but does not seem to make a difference for me.


----------



## ikbendeman (Sep 24, 2013)

I'm getting the same error message too but without the sysctl hint. Question, why load powerd if you want to disable throttling? Isn't that the point?

AMD FX 4.0 Ghz 8-core black edition (unlocked)
Gigabyte 990FX-UD3 (I'll have to double check my mainboard model. But it appears that this bug isn't related to any particular mainboard).

Kernel hackers: what exactly could be going on here?


Apologies for bad formatting I'm on my Galaxy S3.


----------



## ikbendeman (Sep 24, 2013)

I mean I'm getting the 
	
	



```
hwpstate0: set freq failed err 6
```


----------



## SirDice (Sep 24, 2013)

Also with 9.0? Please be advised that FreeBSD 9.0 is End-of-Life. Please upgrade to 9.1.


----------



## ikbendeman (Sep 28, 2013)

*No...*

Sorry, no... I should have included this in my original post:


```
nicholas@******:~ % uname -a
FreeBSD fbsd.fallout 9.2-RC3 FreeBSD 9.2-RC3 #0 r254795: Sat Aug 24 20:25:04 UTC 2013     root@bake.isc.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
```


----------



## mrhe (Oct 4, 2013)

Hello, I have the same info in dmesg:

```
hwpstate0: set freq failed, err 6
hwpstate0: set freq failed, err 6
hwpstate0: set freq failed, err 6
hwpstate0: set freq failed, err 6
hwpstate0: set freq failed, err 6
```


```
root@bacup:/ # sysctl -a | grep cpu
cpu     HAMMER
device  cpufreq
kern.ccpu: 0
kern.sched.cpusetsize: 8
  <cpu count="6" mask="3f">0, 1, 2, 3, 4, 5</cpu>
    <cpu count="6" mask="3f">0, 1, 2, 3, 4, 5</cpu>
kern.smp.cpus: 6
kern.smp.maxcpus: 64
net.inet.tcp.per_cpu_timers: 0
debug.acpi.cpu_unordered: 0
debug.cpufreq.verbose: 0
debug.cpufreq.lowest: 0
hw.ncpu: 6
hw.acpi.cpu.cx_lowest: C1
security.jail.param.cpuset.id: 0
dev.cpu.0.%desc: ACPI CPU
dev.cpu.0.%driver: cpu
dev.cpu.0.%location: handle=\_PR_.C000
dev.cpu.0.%pnpinfo: _HID=none _UID=0
dev.cpu.0.%parent: acpi0
dev.cpu.0.freq: 3300
dev.cpu.0.freq_levels: 3300/14445 3000/11500 2400/7848 1800/4800 1400/3330
dev.cpu.0.cx_supported: C1/0 C2/100
dev.cpu.0.cx_lowest: C1
dev.cpu.0.cx_usage: 100.00% 0.00% last 913us
dev.cpu.1.%desc: ACPI CPU
dev.cpu.1.%driver: cpu
dev.cpu.1.%location: handle=\_PR_.C001
dev.cpu.1.%pnpinfo: _HID=none _UID=0
dev.cpu.1.%parent: acpi0
dev.cpu.1.cx_supported: C1/0 C2/100
dev.cpu.1.cx_lowest: C1
dev.cpu.1.cx_usage: 100.00% 0.00% last 222us
dev.cpu.2.%desc: ACPI CPU
dev.cpu.2.%driver: cpu
dev.cpu.2.%location: handle=\_PR_.C002
dev.cpu.2.%pnpinfo: _HID=none _UID=0
dev.cpu.2.%parent: acpi0
dev.cpu.2.cx_supported: C1/0 C2/100
dev.cpu.2.cx_lowest: C1
dev.cpu.2.cx_usage: 100.00% 0.00% last 984us
dev.cpu.3.%desc: ACPI CPU
dev.cpu.3.%driver: cpu
dev.cpu.3.%location: handle=\_PR_.C003
dev.cpu.3.%pnpinfo: _HID=none _UID=0
dev.cpu.3.%parent: acpi0
dev.cpu.3.cx_supported: C1/0 C2/100
dev.cpu.3.cx_lowest: C1
dev.cpu.3.cx_usage: 100.00% 0.00% last 712us
dev.cpu.4.%desc: ACPI CPU
dev.cpu.4.%driver: cpu
dev.cpu.4.%location: handle=\_PR_.C004
dev.cpu.4.%pnpinfo: _HID=none _UID=0
dev.cpu.4.%parent: acpi0
dev.cpu.4.cx_supported: C1/0 C2/100
dev.cpu.4.cx_lowest: C1
dev.cpu.4.cx_usage: 100.00% 0.00% last 416us
dev.cpu.5.%desc: ACPI CPU
dev.cpu.5.%driver: cpu
dev.cpu.5.%location: handle=\_PR_.C005
dev.cpu.5.%pnpinfo: _HID=none _UID=0
dev.cpu.5.%parent: acpi0
dev.cpu.5.cx_supported: C1/0 C2/100
dev.cpu.5.cx_lowest: C1
dev.cpu.5.cx_usage: 100.00% 0.00% last 708us
dev.acpi_perf.0.%parent: cpu0
dev.acpi_perf.1.%parent: cpu1
dev.acpi_perf.2.%parent: cpu2
dev.acpi_perf.3.%parent: cpu3
dev.acpi_perf.4.%parent: cpu4
dev.acpi_perf.5.%parent: cpu5
dev.hwpstate.0.%parent: cpu0
dev.cpufreq.0.%driver: cpufreq
dev.cpufreq.0.%parent: cpu0
```


```
root@backup:/ # uname -a
FreeBSD mpbk1 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243825: Tue Dec  4 09:23:10 UTC 2012     [email]root@farrell.cse.buffalo.edu[/email]:/usr/obj/usr/src/sys/GENERIC  amd64
```


----------



## vans9 (Oct 7, 2013)

Hello.

I've upgraded 9.0 -> 9.1 and 9.1 -> 9.2. I confirm these for 9.2 too.


----------



## gpeskens (Nov 2, 2013)

*C*onfirmed also for 10-BETA2*.*


----------



## ikbendeman (Nov 23, 2013)

I'm on 9.2-STABLE and I get a 
	
	



```
WARNING: hint.acpi_throttle.disabled sysctl does not exist
```
 or some such error.


----------



## ikbendeman (Dec 1, 2013)

*Suppress the message?*



			
				ikbendeman said:
			
		

> I'm on 9.2-STABLE and I get a
> 
> 
> 
> ...


Can anyone help me with this? And is there anyway to suppress the following from filling up my dmesg?

```
hwpstate0: set freq failed, err 6
hwpstate0: set freq failed, err 6
hwpstate0: set freq failed, err 6
hwpstate0: set freq failed, err 6
hwpstate0: set freq failed, err 6
hwpstate0: set freq failed, err 6
hwpstate0: set freq failed, err 6
hwpstate0: set freq failed, err 6
hwpstate0: set freq failed, err 6
hwpstate0: set freq failed, err 6
hwpstate0: set freq failed, err 6
```
It happens every few seconds, so no more running -STABLE; I can't use dmesg for a single stinking thing.


----------



## raul321 (Dec 2, 2013)

Hello,

I have the same problem:


```
freebsd#  sysctl -a | egrep -i 'hw.machine|hw.model|hw.ncpu'
hw.machine: amd64
hw.model: AMD FX(tm)-6100 Six-Core Processor
hw.ncpu: 6
hw.machine_arch: amd64
```

*I*n dmsg *I* have:

```
hwpstate0: set freq failed, err 6
```

Then *I*'ve changed in loader.conf:


```
freebsd# cat loader.conf
########### hwpstate0: set freq failed, err 6 ##############
debug.hwpstate_verbose="1"
hint.acpi_throttle.0.disabled="1"
```

*N*ow in dmesg:

```
hwpstate0: setting P0-state on cpu0
hwpstate0: result  P0-state on cpu0
hwpstate0: setting P0-state on cpu1
hwpstate0: result  P0-state on cpu1
hwpstate0: setting P0-state on cpu2
hwpstate0: result  P0-state on cpu2
hwpstate0: setting P0-state on cpu3
hwpstate0: result  P0-state on cpu3
hwpstate0: setting P0-state on cpu4
hwpstate0: result  P0-state on cpu4
hwpstate0: setting P0-state on cpu5
hwpstate0: result  P0-state on cpu5
```

*I* have FreeBSD freebsd 9.1-RELEASE*.*


----------



## raul321 (Dec 2, 2013)

```
freebsd# powerd -v
powerd: unable to determine AC line status
load 127%, current freq 3300 MHz ( 0), wanted freq 6600 MHz
load 124%, current freq 3300 MHz ( 0), wanted freq 6600 MHz
load 227%, current freq 3300 MHz ( 0), wanted freq 6600 MHz
load 227%, current freq 3300 MHz ( 0), wanted freq 6600 MHz
load 241%, current freq 3300 MHz ( 0), wanted freq 6600 MHz
load 209%, current freq 3300 MHz ( 0), wanted freq 6600 MHz
load 212%, current freq 3300 MHz ( 0), wanted freq 6600 MHz
load 243%, current freq 3300 MHz ( 0), wanted freq 6600 MHz
load 176%, current freq 3300 MHz ( 0), wanted freq 6600 MHz
load 287%, current freq 3300 MHz ( 0), wanted freq 6600 MHz
load 268%, current freq 3300 MHz ( 0), wanted freq 6600 MHz
```


----------



## clod89 (Dec 8, 2013)

It should be fixed now in 10.0. Just wait for RC1 or use a recent snapshot.

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


----------



## TeoLinuX (Dec 28, 2013)

I confirm, same problem here.


```
uname -a
FreeBSD mynas4free.local 9.1-RELEASE-p5 FreeBSD 9.1-RELEASE-p5
```
I'm running FreeBSD 9.1 on Nas4Free NAS.

On this system:

```
sysctl -a | egrep -i 'hw.machine|hw.model|hw.ncpu'
hw.machine: amd64
hw.model: AMD A4-4000 APU with Radeon(tm) HD Graphics    
hw.ncpu: 2
hw.machine_arch: amd64
```

ASRock FM2A75M-DGS motherboard; BIOS is updated and Cool'n'quiet active.

I must use

```
hint.acpi_throttle.0.disabled="1"
```
in order to disable the error flooding my log.

BTW: I can't read CPU temperature, is it normal?
Any help is appreciated.


----------



## Shoikan (Jan 10, 2014)

I've run into this too, and this appears to be a quirk of the CPU. If I recall correctly the cause is that cpufreq somehow tries to set the speed of all cores separately, when it can actually only set it for one. This causes the message to be displayed. And these CPUs also have some weirdness with their temperature sensor, which doesn't report absolute temperatures anymore, but an offset from the set 'max temp' in BIOS. Note that this comes from memory, so may be a bit garbled. It was a while back that I investigated it myself.


----------



## phoenix (Jan 10, 2014)

TeoLinuX said:
			
		

> On this system:
> 
> ```
> sysctl -a | egrep -i 'hw.machine|hw.model|hw.ncpu'
> ...



Just a quick aside, you don't need to use -a or pipe the result through grep, just list the sysctl nodes you want to display:

```
[fcash@alphadrive  ~]$ sysctl hw.machine hw.model hw.ncpu
hw.machine: amd64
hw.model: AMD Opteron(tm) Processor 6128
hw.ncpu: 8
```


----------

