From owner-freebsd-acpi@FreeBSD.ORG Thu Mar 26 14:28:54 2009 Return-Path: Delivered-To: freebsd-acpi@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9242D10656D0 for ; Thu, 26 Mar 2009 14:28:54 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (brucec-1-pt.tunnel.tserv4.nyc4.ipv6.he.net [IPv6:2001:470:1f06:c09::2]) by mx1.freebsd.org (Postfix) with ESMTP id 622C58FC13 for ; Thu, 26 Mar 2009 14:28:54 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (localhost [127.0.0.1]) by muon.cran.org.uk (Postfix) with ESMTP id 02D7E19017; Thu, 26 Mar 2009 14:28:53 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on muon X-Spam-Level: X-Spam-Status: No, score=-2.6 required=8.0 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 Received: from gluon.draftnet (unknown [IPv6:2a01:348:10f:0:240:f4ff:fe57:9871]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA; Thu, 26 Mar 2009 14:28:52 +0000 (GMT) Date: Thu, 26 Mar 2009 14:28:32 +0000 From: Bruce Cran To: Andriy Gapon Message-ID: <20090326142832.0dba187a@gluon.draftnet> In-Reply-To: <49CB8C86.4020800@icyb.net.ua> References: <200903200030.n2K0U3iG011009@freefall.freebsd.org> <20090325223914.4387eeae@gluon.draftnet> <49CB8C86.4020800@icyb.net.ua> X-Mailer: Claws Mail 3.7.1 (GTK+ 2.14.7; i386-portbld-freebsd7.2) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-acpi@FreeBSD.org Subject: Re: kern/108581: [sysctl] sysctl: hw.acpi.cpu.cx_lowest: Invalid argument X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Mar 2009 14:28:55 -0000 On Thu, 26 Mar 2009 16:09:10 +0200 Andriy Gapon wrote: > on 26/03/2009 00:39 Bruce Cran said the following: > > On Fri, 20 Mar 2009 00:30:03 GMT > > Daniel Dvo=C5=99=C3=A1k wrote: > >=20 > >> The following reply was made to PR kern/108581; it has been noted > >> by GNATS. > >> > >> From: =3D?UTF-8?Q?Daniel_Dvo=3DC5=3D99=3DC3=3DA1k?=3D > >> To: , > >> > >> Cc: =20 > >> Subject: Re: kern/108581: [sysctl] sysctl: hw.acpi.cpu.cx_lowest: > >> Invalid argument Date: Fri, 20 Mar 2009 01:01:51 +0100 > >> > >> This is a multi-part message in MIME format. > >> =20 > >> ------=3D_NextPart_000_0007_01C9A8F7.746C4190 > >> Content-Type: text/plain; > >> charset=3D"UTF-8" > >> Content-Transfer-Encoding: quoted-printable > >> =20 > >> Hi acpi team, > >> =3D20 > >> today I have installed fbsd 7.1R on one box with this relativly > >> old =3D error and I was surprised about results .. it is the same: > >> =3D20 > >> # uname -a > >> FreeBSD X.Y.Z 7.1-RELEASE FreeBSD 7.1-RELEASE #0: Thu Jan 1 > >> 14:37:25 =3D UTC 2009 > >> root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC =3D i386 > >> =20 > >> # sysctl dev.cpu.0.cx_supported > >> dev.cpu.0.cx_supported: C1/0 > >> =20 > >> # sysctl hw.acpi.cpu.cx_lowest=3D3DC1 > >> hw.acpi.cpu.cx_lowest: C1 > >> sysctl: hw.acpi.cpu.cx_lowest: Invalid argument > >> =3D20 > >> # sysctl hw.acpi.cpu.cx_lowest=3D3DC0 > >> hw.acpi.cpu.cx_lowest: C1 > >> sysctl: hw.acpi.cpu.cx_lowest: Invalid argument > >> =3D20 > >> # sysctl hw.acpi.cpu.cx_lowest=3D3DC1/0 > >> hw.acpi.cpu.cx_lowest: C1 > >> sysctl: hw.acpi.cpu.cx_lowest: Invalid argument > >> =20 > >> # dmesg -a | grep "acpi" > >> acpi0: on motherboard > >> acpi0: Overriding SCI Interrupt from IRQ 9 to IRQ 20 > >> acpi0: [ITHREAD] > >> acpi0: Power Button (fixed) > >> acpi0: reservation of 0, a0000 (3) failed > >> acpi0: reservation of 100000, ff00000 (3) failed > >> acpi_timer0: <24-bit timer at 3.579545MHz> port 0xe408-0xe40b on > >> acpi0 acpi_button0: on acpi0 > >> pcib0: port 0xcf8-0xcff on acpi0 > >> atkbdc0: port 0x60,0x64 irq 1 on > >> acpi0 cpu0: on acpi0 > >> hw.acpi.cpu.cx_lowest: > >> hw.acpi.cpu.cx_lowest > >=20 > > I think I've found the problem and have updated the PR kern/108581 > > (http://www.freebsd.org/cgi/query-pr.cgi?pr=3Dkern/108581). The global > > cpu_cx_count was being initialized to 0 in acpi_cpu_startup > > (in /sys/dev/acpica/acpi_cpu.c) but code below it appears to assume > > that it's been intialized to 3 because it only sets it if it's > > higher than the current CPU supports - that is, cpu_cx_count should > > reflect the highest Cx state that all CPUs support. >=20 > If you specifically mean the generic case (non-cst) as you mention in > the PR, then I think that you didn't notice that cpu_cx_count (the > global variable) gets updated in acpi_cpu_generic_cx_probe, So after > looping over all CPUs it has the value of the maximum Cx level > supported by at least one CPU. Only then we loop again and determine > the smallest of the supported maximums. Yes, I had missed that. I think the problem however is still that in the generic cx case the global is re-initialized to 0 and never gets updated. --=20 Bruce Cran