From owner-freebsd-acpi@FreeBSD.ORG Fri May 8 10:34: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 85CC0106566B; Fri, 8 May 2009 10:34:54 +0000 (UTC) (envelope-from onemda@gmail.com) Received: from mail-bw0-f165.google.com (mail-bw0-f165.google.com [209.85.218.165]) by mx1.freebsd.org (Postfix) with ESMTP id 7F48B8FC0C; Fri, 8 May 2009 10:34:53 +0000 (UTC) (envelope-from onemda@gmail.com) Received: by bwz9 with SMTP id 9so1285555bwz.43 for ; Fri, 08 May 2009 03:34:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=p2cItQSo7NSeVItexvTC4atsaRofqEwF9mh9nWatND8=; b=KdBo0A80m64jlcGk70IH/13IzI12ys138mpqzwvvVsHxCGsxnOq8hMgUjD6Cr+KjZ3 kywEIm9Lt9dngtOh8ga5yxQXLl8Wl6P259L/dofE7ORFuhnvLqA/oMt0bv/PrdF802lc Wi8nuT7QT+UrSaTBTx2nJ5Y6I/xNsKgmJ6E8A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=Cn3iRY7MelgofEeezLYWo+6ckjLqPH15X0Us402zeC3yqlhRhi+SslGMTARtb8ARhC uRm9pxToIoqYOvVVXTlrNyzsJZvBH9yWc6mOcKfy6WaNDtWLb/Q9N8HfHSpKgHGW1tl4 +AUGmvNTr8eT6PQEtOGgu8Htz2FPB3jnIYiuA= MIME-Version: 1.0 Received: by 10.239.154.83 with SMTP id d19mr206468hbc.33.1241778892413; Fri, 08 May 2009 03:34:52 -0700 (PDT) In-Reply-To: <20090507.001059.-1558772981.imp@bsdimp.com> References: <49FE1826.4060000@FreeBSD.org> <3a142e750905040240g58152e69p6fcb797a5e026426@mail.gmail.com> <20090507.001059.-1558772981.imp@bsdimp.com> Date: Fri, 8 May 2009 10:34:52 +0000 Message-ID: <3a142e750905080334qb62dcb5hcd07ce028a4ff035@mail.gmail.com> From: "Paul B. Mahol" To: "M. Warner Losh" Content-Type: text/plain; charset=ISO-8859-1 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-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: Fri, 08 May 2009 10:34:55 -0000 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? -- Paul