From owner-cvs-all@FreeBSD.ORG Wed Dec 8 06:42:00 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6501216A4CE; Wed, 8 Dec 2004 06:42:00 +0000 (GMT) Received: from ylpvm15.prodigy.net (ylpvm15-ext.prodigy.net [207.115.57.46]) by mx1.FreeBSD.org (Postfix) with ESMTP id 14DA443D46; Wed, 8 Dec 2004 06:42:00 +0000 (GMT) (envelope-from nate@root.org) Received: from [10.0.5.50] (adsl-64-171-186-123.dsl.snfc21.pacbell.net [64.171.186.123])iB86g7Hr022747; Wed, 8 Dec 2004 01:42:08 -0500 Message-ID: <41B6A235.9070303@root.org> Date: Tue, 07 Dec 2004 22:41:57 -0800 From: Nate Lawson User-Agent: Mozilla Thunderbird 1.0RC1 (X11/20041205) X-Accept-Language: en-us, en MIME-Version: 1.0 To: John Baldwin References: <200412020804.iB284vFx055098@repoman.freebsd.org> <200412031433.10222.jhb@FreeBSD.org> In-Reply-To: <200412031433.10222.jhb@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/acpica acpi_if.m X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2004 06:42:00 -0000 John Baldwin wrote: > On Thursday 02 December 2004 03:04 am, Nate Lawson wrote: >> >> Modified files: >> sys/dev/acpica acpi_if.m >> Log: >> Add the ACPI_PWR_FOR_SLEEP method. It takes a device and outputs the >> appropriate power (Dx) state, if the BIOS suggests one. > > Should this really be ACPI specific? Why not add a method that pci bridges > pass to their parent that will bubble up to the host-pci bridge's parent > (acpi0, legacy0, etc.) that determines which sleep state should be used? > This would let open firmware machines manage this stuff in their nexus0 for > example if they wanted. It would be a pci bus method that the platform > drivers would implement as well in that model, and wouldn't be ACPI specific. It's a good discussion to have. In this case, I think it should be "ACPI_PWR_FOR_SLEEP" since there is no other mechanism I know for getting a Sx to Dx mapping (sleep state to device power state). The method is not acpi specific anyway. It just takes a device_t and outputs an integer. Machines with openfirmware could implement the same method as long as the implementation could conform to these semantics and interface. We have this issue elsewhere in that ACPI is not a PCI bus but it implements the PCI_SET_POWERSTATE method. This is ok though since the method has PCI semantics even though the ACPI legacy bus (i.e., ISA) is not PCI in other ways. We could call this POWER_SET_STATE to be more generic, but then if there was another set of semantics for some other system, we'd have a namespace collision. I prefer method names to conform to the interface, as in "operates the same as PCI power state setting". A completely separate problem is the fact that acpi_if.m has lots of ACPI-specific types as parameters. To clean it up, I plan to forward-declare the ACPI types so this file can be self-contained and included without prerequisites. -- Nate