From owner-freebsd-current@FreeBSD.ORG Fri May 8 13:10:39 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A3D01065673; Fri, 8 May 2009 13:10:39 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id BBFEA8FC12; Fri, 8 May 2009 13:10:38 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id n48D70nR089707; Fri, 8 May 2009 07:07:01 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Fri, 08 May 2009 07:06:59 -0600 (MDT) Message-Id: <20090508.070659.1622573996.imp@bsdimp.com> To: onemda@gmail.com From: "M. Warner Losh" In-Reply-To: <3a142e750905080334qb62dcb5hcd07ce028a4ff035@mail.gmail.com> References: <3a142e750905040240g58152e69p6fcb797a5e026426@mail.gmail.com> <20090507.001059.-1558772981.imp@bsdimp.com> <3a142e750905080334qb62dcb5hcd07ce028a4ff035@mail.gmail.com> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: mav@freebsd.org, freebsd-current@freebsd.org, freebsd-acpi@freebsd.org, freebsd-mobile@freebsd.org Subject: Re: Fighting for the power. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 May 2009 13:10:39 -0000 In message: <3a142e750905080334qb62dcb5hcd07ce028a4ff035@mail.gmail.com> "Paul B. Mahol" writes: : On 5/7/09, M. Warner Losh wrote: : > In message: <3a142e750905040240g58152e69p6fcb797a5e026426@mail.gmail.com> : > "Paul B. Mahol" writes: : > : On 5/4/09, Alexander Motin wrote: : > : > 2. PCI devices : > : > PCI bus provides method to control device power. For example, I have : > : > completely no use for my FireWire controller and most of time - EHCI USB : > : > controller. Disabling them allows me to save about 3W of power. To : > : > disable all unneeded PCI devices you should build kernel without their : > : > drivers and add to loader.conf: : > : > hw.pci.do_power_nodriver=3 : > : > To enable devices back all you need to do is just load their drivers as : > : > modules. : > : : > : Unloading modules doesnt put them back into into D3 state. : > : You are forced to load some another module again to put wanted device : > : into D3 state. : > : > It should. If it isn't, that's a bug. : : It's a bug. : : On machine resume(pci_resume), pci_cfg_restore() is called causing D3 -> D0 for : all devices(including not attached ones). : Unloading module/detaching device doesn't call pci_cfg_save. : : Should device_detach routine be used or new one like : pci_driver_removed() implemented? No. device_detach shouldn't be used for this. This should happen all in the PCI bus code when do_power_nodriver is > 0. Warner