From nobody@FreeBSD.org  Mon Dec 18 05:57:21 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 1264B16A492
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 18 Dec 2006 05:57:21 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.FreeBSD.org (Postfix) with ESMTP id A79B943CA8
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 18 Dec 2006 05:57:20 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id kBI5vKg5076954
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 18 Dec 2006 05:57:20 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id kBI5vKX3076941;
	Mon, 18 Dec 2006 05:57:20 GMT
	(envelope-from nobody)
Message-Id: <200612180557.kBI5vKX3076941@www.freebsd.org>
Date: Mon, 18 Dec 2006 05:57:20 GMT
From: David<dbmoler@yahoo.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: powernow0 attach returned 6
X-Send-Pr-Version: www-3.0

>Number:         106850
>Category:       i386
>Synopsis:       [powerd] powernow0 attach returned 6
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-i386
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 18 06:00:32 GMT 2006
>Closed-Date:    Wed Mar 30 06:22:11 UTC 2011
>Last-Modified:  Wed Mar 30 06:22:11 UTC 2011
>Originator:     David
>Release:        RELENG_6
>Organization:
>Environment:
FreeBSD aragorn 6.2-PRERELEASE FreeBSD 6.2-PRERELEASE #30: Sun Dec 17 01:08:30 PST 2006     i386
>Description:
I can't get powerd working on an Athlon X2.  

in rc.conf I have:
powerd_enable="YES"
powerd_flags="-a adaptive -n adaptive -r 25"

in loader.conf I have:
cpufreq_load="YES"

dmesg gives me:

Copyright (c) 1992-2006 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 6.2-PRERELEASE #30: Sun Dec 17 01:08:30 PST 2006
    dbmoler@aragorn:/usr/obj/usr/src/sys/ARAGORN
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ (1999.79-MHz 686-class CPU)
  Origin = "AuthenticAMD"  Id = 0x20fb1  Stepping = 1
  Features=0x178bfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,S
SE2,HTT>
  Features2=0x1<SSE3>
  AMD Features=0xe2500800<SYSCALL,NX,MMX+,FFXSR,LM,3DNow+,3DNow>
  AMD Features2=0x3<LAHF,CMP>
  Cores per package: 2
real memory  = 1072562176 (1022 MB)
avail memory = 1040416768 (992 MB)
ACPI APIC Table: <VIAK8T AWRDACPI>
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
 cpu0 (BSP): APIC ID:  0
 cpu1 (AP): APIC ID:  1
ioapic0: Changing APIC ID to 2
ioapic0 <Version 0.3> irqs 0-23 on motherboard
bktr_mem: memory holder loaded
ath_hal: 0.9.17.2 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, RF5413)
acpi0: <VIAK8T AWRDACPI> on motherboard
acpi0: Power Button (fixed)
Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x4008-0x400b on acpi0
cpu0: <ACPI CPU> on acpi0
powernow0: <Cool`n'Quiet K8> on cpu0
device_attach: powernow0 attach returned 6
cpu1: <ACPI CPU> on acpi0
powernow1: <Cool`n'Quiet K8> on cpu1
device_attach: powernow1 attach returned 6
acpi_button0: <Power Button> on acpi0

I've seen other reports to this effect but no solution.  I had this working
a while ago with the same motherboard, but different cpu.  Not sure when it
stopped working, but it was a while ago.
>How-To-Repeat:
>Fix:

>Release-Note:
>Audit-Trail:

From: David Malone <dwmalone@maths.tcd.ie>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: i386/106850: powernow0 attach returned 6
Date: Sat, 29 Mar 2008 17:43:39 +0000

 I see the same thing on a machine that reports a similar BIOS:
  
 	ACPI APIC Table: <VIAK8  AWRDACPI>
  
 I made the patch below to the driver to see what was going on.
 When I do this, it says:
  
 	cpu0: <ACPI CPU> on acpi0
 	powernow0: <Cool`n'Quiet K8> on cpu0
 	powernow0: STATUS: 0x20200101010
 	powernow0: STATUS: maxfid: 0x10
 	powernow0: STATUS: maxvid: 0x00
 	sig 0
 	after pn_decode_pst rv = 19
 	device_attach: powernow0 attach returned 6
  
 This suggests that the driver has failed to find the tables it needs
 in either the BIOS or ACPI. When I check, there is no _PSS entry
 in my ACPI tables, so the acpi_perf driver never attaches. I would
 guess that this is the real problem.
 
 	David.
  
 Index: powernow.c
 ===================================================================
 RCS file: /cvs/FreeBSD-CVS/src/sys/i386/cpufreq/powernow.c,v
 retrieving revision 1.4
 diff -u -r1.4 powernow.c
 --- powernow.c	23 Jan 2007 19:20:30 -0000	1.4
 +++ powernow.c	27 Jan 2007 17:42:17 -0000
 @@ -673,7 +673,7 @@
  		return (ENODEV);
  	}
  
 -	if (bootverbose) {
 +	if (1 || bootverbose) {
  			return (ENODEV);
 @@ -704,7 +706,7 @@
  			sc->irt = PN8_PSB_TO_IRT(psb->res1),
  			sc->mvs = PN8_PSB_TO_MVS(psb->res1),
  			sc->low = PN8_PSB_TO_BATT(psb->res1);
 -			if (bootverbose) {
 +			if (1 || bootverbose) {
  				device_printf(dev, "PSB: VST: %d\n",
  				    psb->settlingtime);
  				device_printf(dev, "PSB: RVO %x IRT %d "
 @@ -968,10 +970,12 @@
  	child = device_find_child(device_get_parent(dev), "acpi_perf", -1);
  	if (child) {
  		rv = pn_decode_acpi(dev, child);
 +		printf("if (child) rv = %d\n", rv);
  		if (rv)
  			rv = pn_decode_pst(dev);
  	} else
  		rv = pn_decode_pst(dev);
 +	printf("after pn_decode_pst rv = %d\n", rv);
  
  	if (rv != 0)
  		return (ENXIO);
 
 
State-Changed-From-To: open->feedback 
State-Changed-By: remko 
State-Changed-When: Wed Jul 14 07:56:38 UTC 2010 
State-Changed-Why:  
Hello, a lot had change during the time you submitted this and current time, can you please confirm that this is still relevant for current freebsd versions? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=106850 
State-Changed-From-To: feedback->closed 
State-Changed-By: remko 
State-Changed-When: Wed Mar 30 06:22:10 UTC 2011 
State-Changed-Why:  
Feedback timeout 

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