Bug 144551

Summary: [acpi] ACPI issues on SuperMicro X7SPA-H
Product: Base System Reporter: Dan Naumov <dan.naumov>
Component: amd64Assignee: freebsd-acpi (Nobody) <acpi>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description Dan Naumov 2010-03-08 13:30:02 UTC
In BIOS, the system sees the CPU at 1,66 Ghz frequency, which is the correct maximum frequency for an Atom D510 CPU. However, upon finishing the boot process, without any tunables, the CPU gets stuck at the wrong frequency: dev.cpu.0.freq: 1249 Mhz, severely degrading performance.

Enabling and starting powerd and then putting the system under load will put the CPU to the correct frequency: dev.cpu.0.freq: 1666, however powerd seems to misbehave as well: After the initial frequency increase of the CPU to 1666 Mhz, the CPU gets stuck at this clockrate. Sometimes powerd will work correctly for a minute or so, correctly adjusting the CPU frequency according to load, but in a very short time, the CPU will get stuck at 1666 Mhz permanently (until reboot).

Changing from "highadaptive" to "adaptive" mode in powerd settings seems to have no effect on this behaviour.

System DMESG below:

Copyright (c) 1992-2009 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 8.0-RELEASE-p2 #0: Tue Jan  5 21:11:58 UTC 2010
    root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Intel(R) Atom(TM) CPU D510   @ 1.66GHz (1666.68-MHz K8-class CPU)
  Origin = "GenuineIntel"  Id = 0x106ca  Stepping = 10
  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=0x40e31d<SSE3,DTES64,MON,DS_CPL,TM2,SSSE3,CX16,xTPR,PDCM,<b22>>
  AMD Features=0x20100800<SYSCALL,NX,LM>
  AMD Features2=0x1<LAHF>
  TSC: P-state invariant
real memory  = 4294967296 (4096 MB)
avail memory = 4088082432 (3898 MB)
ACPI APIC Table: <011910 APIC1514>
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
FreeBSD/SMP: 1 package(s) x 2 core(s) x 2 HTT threads
 cpu0 (BSP): APIC ID:  0
 cpu1 (AP/HT): APIC ID:  1
 cpu2 (AP): APIC ID:  2
 cpu3 (AP/HT): APIC ID:  3
ioapic0: Changing APIC ID to 4
ioapic0 <Version 2.0> irqs 0-23 on motherboard
kbd1 at kbdmux0
acpi0: <SMCI > on motherboard
acpi0: [ITHREAD]
acpi0: Power Button (fixed)
acpi0: reservation of fee00000, 1000 (3) failed
acpi0: reservation of 0, a0000 (3) failed
acpi0: reservation of 100000, bf600000 (3) failed
Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x808-0x80b on acpi0
acpi_hpet0: <High Precision Event Timer> iomem 0xfed00000-0xfed003ff on acpi0
Timecounter "HPET" frequency 14318180 Hz quality 900
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
vgapci0: <VGA-compatible display> port 0xcc00-0xcc07 mem 0xfe880000-0xfe8fffff,0xd0000000-0xdfffffff,0xfe900000-0xfe9fffff irq 16 at device 2.0 on pci0
vgapci1: <VGA-compatible display> mem 0xfe780000-0xfe7fffff at device 2.1 on pci0
uhci0: <Intel 82801I (ICH9) USB controller> port 0xc880-0xc89f irq 16 at device 26.0 on pci0
uhci0: [ITHREAD]
uhci0: LegSup = 0x0f00
usbus0: <Intel 82801I (ICH9) USB controller> on uhci0
uhci1: <Intel 82801I (ICH9) USB controller> port 0xc800-0xc81f irq 21 at device 26.1 on pci0
uhci1: [ITHREAD]
uhci1: LegSup = 0x0f00
usbus1: <Intel 82801I (ICH9) USB controller> on uhci1
uhci2: <Intel 82801I (ICH9) USB controller> port 0xc480-0xc49f irq 19 at device 26.2 on pci0
uhci2: [ITHREAD]
uhci2: LegSup = 0x0f00
usbus2: <Intel 82801I (ICH9) USB controller> on uhci2
ehci0: <Intel 82801I (ICH9) USB 2.0 controller> mem 0xfe877c00-0xfe877fff irq 18 at device 26.7 on pci0
ehci0: [ITHREAD]
usbus3: EHCI version 1.0
usbus3: <Intel 82801I (ICH9) USB 2.0 controller> on ehci0
pcib1: <ACPI PCI-PCI bridge> irq 17 at device 28.0 on pci0
pci1: <ACPI PCI bus> on pcib1
pcib2: <ACPI PCI-PCI bridge> irq 17 at device 28.4 on pci0
pci2: <ACPI PCI bus> on pcib2
em0: <Intel(R) PRO/1000 Network Connection 6.9.14> port 0xdc00-0xdc1f mem 0xfeae0000-0xfeafffff,0xfeadc000-0xfeadffff irq 16 at device 0.0 on pci2
em0: Using MSIX interrupts
em0: [ITHREAD]
em0: [ITHREAD]
em0: [ITHREAD]
em0: Ethernet address: 00:25:90:01:32:92
pcib3: <ACPI PCI-PCI bridge> irq 16 at device 28.5 on pci0
pci3: <ACPI PCI bus> on pcib3
em1: <Intel(R) PRO/1000 Network Connection 6.9.14> port 0xec00-0xec1f mem 0xfebe0000-0xfebfffff,0xfebdc000-0xfebdffff irq 17 at device 0.0 on pci3
em1: Using MSIX interrupts
em1: [ITHREAD]
em1: [ITHREAD]
em1: [ITHREAD]
em1: Ethernet address: 00:25:90:01:32:93
uhci3: <Intel 82801I (ICH9) USB controller> port 0xc400-0xc41f irq 23 at device 29.0 on pci0
uhci3: [ITHREAD]
uhci3: LegSup = 0x0f00
usbus4: <Intel 82801I (ICH9) USB controller> on uhci3
uhci4: <Intel 82801I (ICH9) USB controller> port 0xc080-0xc09f irq 19 at device 29.1 on pci0
uhci4: [ITHREAD]
uhci4: LegSup = 0x0f00
usbus5: <Intel 82801I (ICH9) USB controller> on uhci4
uhci5: <Intel 82801I (ICH9) USB controller> port 0xc000-0xc01f irq 18 at device 29.2 on pci0
uhci5: [ITHREAD]
uhci5: LegSup = 0x0f00
usbus6: <Intel 82801I (ICH9) USB controller> on uhci5
ehci1: <Intel 82801I (ICH9) USB 2.0 controller> mem 0xfe877800-0xfe877bff irq 23 at device 29.7 on pci0
ehci1: [ITHREAD]
usbus7: EHCI version 1.0
usbus7: <Intel 82801I (ICH9) USB 2.0 controller> on ehci1
pcib4: <ACPI PCI-PCI bridge> at device 30.0 on pci0
pci4: <ACPI PCI bus> on pcib4
isab0: <PCI-ISA bridge> at device 31.0 on pci0
isa0: <ISA bus> on isab0
ahci0: <AHCI controller> port 0xb400-0xb407,0xbc00-0xbc03,0xb880-0xb887,0xb800-0xb803,0xb480-0xb49f mem 0xfe877000-0xfe8777ff irq 19 at device 31.2 on pci0
ahci0: [ITHREAD]
ahci0: AHCI v1.20 with 6 3Gbps ports, Port Multiplier not supported
ahcich0: <AHCI channel> at channel 0 on ahci0
ahcich0: [ITHREAD]
ahcich1: <AHCI channel> at channel 1 on ahci0
ahcich1: [ITHREAD]
ahcich2: <AHCI channel> at channel 2 on ahci0
ahcich2: [ITHREAD]
ahcich3: <AHCI channel> at channel 3 on ahci0
ahcich3: [ITHREAD]
ahcich4: <AHCI channel> at channel 4 on ahci0
ahcich4: [ITHREAD]
ahcich5: <AHCI channel> at channel 5 on ahci0
ahcich5: [ITHREAD]
pci0: <serial bus, SMBus> at device 31.3 (no driver attached)
acpi_button0: <Power Button> on acpi0
atrtc0: <AT realtime clock> port 0x70-0x71 irq 8 on acpi0
uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
uart0: [FILTER]
uart1: <16550 or compatible> port 0x2f8-0x2ff irq 3 on acpi0
uart1: [FILTER]
cpu0: <ACPI CPU> on acpi0
p4tcc0: <CPU Frequency Thermal Control> on cpu0
cpu1: <ACPI CPU> on acpi0
p4tcc1: <CPU Frequency Thermal Control> on cpu1
cpu2: <ACPI CPU> on acpi0
p4tcc2: <CPU Frequency Thermal Control> on cpu2
cpu3: <ACPI CPU> on acpi0
p4tcc3: <CPU Frequency Thermal Control> on cpu3
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
atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 on isa0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
atkbd0: [ITHREAD]
ppc0: cannot reserve I/O port range
ZFS NOTICE: Prefetch is disabled by default if less than 4GB of RAM is present;
            to enable, add "vfs.zfs.prefetch_disable=0" to /boot/loader.conf.
ZFS filesystem version 13
ZFS storage pool version 13
Timecounters tick every 1.000 msec
Waiting 5 seconds for SCSI devices to settle
usbus0: 12Mbps Full Speed USB v1.0
usbus1: 12Mbps Full Speed USB v1.0
usbus2: 12Mbps Full Speed USB v1.0
usbus3: 480Mbps High Speed USB v2.0
usbus4: 12Mbps Full Speed USB v1.0
usbus5: 12Mbps Full Speed USB v1.0
usbus6: 12Mbps Full Speed USB v1.0
usbus7: 480Mbps High Speed USB v2.0
ugen0.1: <Intel> at usbus0
uhub0: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus0
ugen1.1: <Intel> at usbus1
uhub1: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus1
ugen2.1: <Intel> at usbus2
uhub2: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus2
ugen3.1: <Intel> at usbus3
uhub3: <Intel EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus3
ugen4.1: <Intel> at usbus4
uhub4: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus4
ugen5.1: <Intel> at usbus5
uhub5: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus5
ugen6.1: <Intel> at usbus6
uhub6: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus6
ugen7.1: <Intel> at usbus7
uhub7: <Intel EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus7
uhub0: 2 ports with 2 removable, self powered
uhub1: 2 ports with 2 removable, self powered
uhub2: 2 ports with 2 removable, self powered
uhub4: 2 ports with 2 removable, self powered
uhub5: 2 ports with 2 removable, self powered
uhub6: 2 ports with 2 removable, self powered
uhub3: 6 ports with 6 removable, self powered
uhub7: 6 ports with 6 removable, self powered
(aprobe0:ahcich0:0:0:0): SIGNATURE: 0000
(aprobe1:ahcich1:0:0:0): SIGNATURE: 0000
ada0 at ahcich0 bus 0 target 0 lun 0
ada0: <WDC WD20EADS-00R6B0 01.00A01> ATA/ATAPI-8 SATA 2.x device
ada0: 300.000MB/s transfers
ada0: 1907729MB (3907029168 512 byte sectors: 16H 63S/T 16383C)
ada0: Native Command Queueing enabled
ada1 at ahcich1 bus 0 target 0 lun 0
ada1: <WDC WD20EADS-32R6B0 01.00A01> ATA/ATAPI-8 SATA 2.x device
ada1: 300.000MB/s transfers
ada1: 1907729MB (3907029168 512 byte sectors: 16H 63S/T 16383C)
ada1: Native Command Queueing enabled
SMP: AP CPU #1 Launched!
SMP: AP CPU #3 Launched!
SMP: AP CPU #2 Launched!
Trying to mount root from zfs:cerberus/ROOT/cerberus
em1: link state changed to UP

Fix: 

As a workaround to getting stuck at 1249Mhz upon boot, the frequency can be manually adjusted.

No fix or workaround known for the powerd behaviour.
How-To-Repeat: Install FreeBSD 8.0 on a system using a SuperMicro X7SPA-H board and boot the system.
Comment 1 Dan Naumov 2010-03-08 13:41:55 UTC
atombsd# sysctl -a | grep acpi
debug.acpi.suspend_bounce: 0
debug.acpi.reset_clock: 1
debug.acpi.do_powerstate: 1
debug.acpi.acpi_ca_version: 20090521
debug.acpi.ec.timeout: 750
debug.acpi.ec.polled: 0
debug.acpi.ec.burst: 0
debug.acpi.batt.batt_sleep_ms: 0
debug.acpi.resume_beep: 0
hw.acpi.supported_sleep_state: S1 S3 S4 S5
hw.acpi.power_button_state: S5
hw.acpi.sleep_button_state: S1
hw.acpi.lid_switch_state: NONE
hw.acpi.standby_state: S1
hw.acpi.suspend_state: S3
hw.acpi.sleep_delay: 1
hw.acpi.s4bios: 0
hw.acpi.verbose: 0
hw.acpi.disable_on_reboot: 0
hw.acpi.handle_reboot: 0
hw.acpi.reset_video: 0
hw.acpi.cpu.cx_lowest: C1
machdep.acpi_timer_freq: 3579545
machdep.acpi_root: 1025856
machdep.idle: acpi
machdep.idle_available: spin, mwait, mwait_hlt, hlt, acpi,
dev.acpi.0.%desc: SMCI
dev.acpi.0.%driver: acpi
dev.acpi.0.%parent: nexus0
dev.acpi_sysresource.0.%desc: System Resource
dev.acpi_sysresource.0.%driver: acpi_sysresource
dev.acpi_sysresource.0.%location: handle=\_SB_.PCI0.MCH_
dev.acpi_sysresource.0.%pnpinfo: _HID=PNP0C01 _UID=10
dev.acpi_sysresource.0.%parent: acpi0
dev.acpi_sysresource.1.%desc: System Resource
dev.acpi_sysresource.1.%driver: acpi_sysresource
dev.acpi_sysresource.1.%location: handle=\_SB_.PCI0.SBRG.SIO2
dev.acpi_sysresource.1.%pnpinfo: _HID=PNP0C02 _UID=5710
dev.acpi_sysresource.1.%parent: acpi0
dev.acpi_sysresource.2.%desc: System Resource
dev.acpi_sysresource.2.%driver: acpi_sysresource
dev.acpi_sysresource.2.%location: handle=\_SB_.PCI0.SBRG.SIO3
dev.acpi_sysresource.2.%pnpinfo: _HID=PNP0C02 _UID=78
dev.acpi_sysresource.2.%parent: acpi0
dev.acpi_sysresource.3.%desc: System Resource
dev.acpi_sysresource.3.%driver: acpi_sysresource
dev.acpi_sysresource.3.%location: handle=\_SB_.PCI0.SBRG.SIOR
dev.acpi_sysresource.3.%pnpinfo: _HID=PNP0C02 _UID=46
dev.acpi_sysresource.3.%parent: acpi0
dev.acpi_sysresource.4.%desc: System Resource
dev.acpi_sysresource.4.%driver: acpi_sysresource
dev.acpi_sysresource.4.%location: handle=\_SB_.PCI0.SBRG.RMSC
dev.acpi_sysresource.4.%pnpinfo: _HID=PNP0C02 _UID=16
dev.acpi_sysresource.4.%parent: acpi0
dev.acpi_sysresource.5.%desc: System Resource
dev.acpi_sysresource.5.%driver: acpi_sysresource
dev.acpi_sysresource.5.%location: handle=\_SB_.PCI0.SBRG.OMSC
dev.acpi_sysresource.5.%pnpinfo: _HID=PNP0C02 _UID=0
dev.acpi_sysresource.5.%parent: acpi0
dev.acpi_sysresource.6.%desc: System Resource
dev.acpi_sysresource.6.%driver: acpi_sysresource
dev.acpi_sysresource.6.%location: handle=\_SB_.PCI0.PCIE
dev.acpi_sysresource.6.%pnpinfo: _HID=PNP0C02 _UID=17
dev.acpi_sysresource.6.%parent: acpi0
dev.acpi_sysresource.7.%desc: System Resource
dev.acpi_sysresource.7.%driver: acpi_sysresource
dev.acpi_sysresource.7.%location: handle=\_SB_.RMEM
dev.acpi_sysresource.7.%pnpinfo: _HID=PNP0C01 _UID=1
dev.acpi_sysresource.7.%parent: acpi0
dev.acpi_timer.0.%desc: 24-bit timer at 3.579545MHz
dev.acpi_timer.0.%driver: acpi_timer
dev.acpi_timer.0.%location: unknown
dev.acpi_timer.0.%pnpinfo: unknown
dev.acpi_timer.0.%parent: acpi0
dev.pci_link.0.%parent: acpi0
dev.pci_link.1.%parent: acpi0
dev.pci_link.2.%parent: acpi0
dev.pci_link.3.%parent: acpi0
dev.pci_link.4.%parent: acpi0
dev.pci_link.5.%parent: acpi0
dev.pci_link.6.%parent: acpi0
dev.pci_link.7.%parent: acpi0
dev.acpi_hpet.0.%desc: High Precision Event Timer
dev.acpi_hpet.0.%driver: acpi_hpet
dev.acpi_hpet.0.%location: unknown
dev.acpi_hpet.0.%pnpinfo: unknown
dev.acpi_hpet.0.%parent: acpi0
dev.pcib.0.%parent: acpi0
dev.acpi_button.0.%desc: Power Button
dev.acpi_button.0.%driver: acpi_button
dev.acpi_button.0.%location: handle=\_SB_.PWRB
dev.acpi_button.0.%pnpinfo: _HID=PNP0C0C _UID=170
dev.acpi_button.0.%parent: acpi0
dev.atdma.0.%parent: acpi0
dev.attimer.0.%parent: acpi0
dev.atrtc.0.%parent: acpi0
dev.fpupnp.0.%parent: acpi0
dev.uart.0.%parent: acpi0
dev.uart.1.%parent: acpi0
dev.cpu.0.%parent: acpi0
dev.cpu.1.%parent: acpi0
dev.cpu.2.%parent: acpi0
dev.cpu.3.%parent: acpi0
Comment 2 Dan Naumov 2010-03-08 15:21:14 UTC
A slight clarification to this text: "Sometimes powerd will work
correctly for a minute or so, correctly adjusting the CPU frequency
according to load, but in a very short time, the CPU will get stuck at
1666 Mhz permanently (until reboot)."

What I ment was: enabling powerd in either hiadaptive or adaptive mode
will eventually put the CPU to 1666 Mhz. However within a short
timeframe, powerd stops downclocking the CPU when idle and the CPU
stays at 1666 Mhz. If powerd is disabled after this, the CPU continues
to stay at 1666 Mhz.

The CPU isn't actually "stuck" at a specific clock per se (bad wording
on my choice), but powerd kind of seems to be. If follow by starting
powerd in min mode, it will change the frequence to the lowest
possible succesfully. If I stop it and then restart again in
hiadaptive or adaptive mode, the CPU again gets stuck at 1666 Mhz.


- Dan
Comment 3 Dan Naumov 2010-03-08 15:27:47 UTC
ACPI dump available at: http://jago.pp.fi/x7spa-h.asl

Note, however:

acpidump -dt > x7spa-h.asl
acpidump: RSDT entry 4 (sig OEMB) is corrupt
Comment 4 Dan Naumov 2010-03-08 16:39:04 UTC
OK, now I feel a bit stupid. The second half of my PR (anything
related to powerd behaviour) can be ignored. For testing purposes, I
started powerd in the foreground and observed it's behaviour. It works
exactly as advertised and apparently the very act of issuing a "sysctl
-a | grep dev.cpu.0.freq" command uses up a high % of CPU time for a
fraction of a second, resulting in confusing output, I was always
getting the highest cpu frequency state as the output. Testing powerd
in foreground however, shows correct behaviour, CPU is downclocked
both before and after issuing that command :)

Still doesn't explain why the system boots up at 1249 Mhz, but that's
not that big of an issue at this point now I see that powerd is
behaving correctly.

- Sincerely,
Dan Naumov
Comment 5 Mark Linimon freebsd_committer freebsd_triage 2010-03-08 19:27:04 UTC
Responsible Changed
From-To: freebsd-amd64->freebsd-acpi

reassign.
Comment 6 Andriy Gapon freebsd_committer freebsd_triage 2010-12-05 14:13:28 UTC
It's interesting question why the frequency at boot time is not the maximu
frequency, but I suspect that it's more of a question to vendor/BIOS.

Would you mind if I close this PR?

-- 
Andriy Gapon
Comment 7 Dan Naumov 2010-12-06 01:41:44 UTC
On Sun, Dec 5, 2010 at 4:13 PM, Andriy Gapon <avg@freebsd.org> wrote:

>
> It's interesting question why the frequency at boot time is not the maximu
> frequency, but I suspect that it's more of a question to vendor/BIOS.
>
> Would you mind if I close this PR?
>
> --
> Andriy Gapon
>


Go ahead.

Sincerely.
- Dan Naumov
Comment 8 Andriy Gapon freebsd_committer freebsd_triage 2010-12-06 09:40:06 UTC
State Changed
From-To: open->closed

This doesn't seem to be a FreeBSD issue.