From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Rafael J. Wysocki" Subject: Re: [PATCH 8/8] PCI: Simplify PCI device PM code (rev. 4) Date: Fri, 11 Jul 2008 22:45:28 +0200 Message-ID: <200807112245.29148.rjw@sisk.pl> References: <200807012356.26669.rjw@sisk.pl> <200807070336.25004.rjw@sisk.pl> <20080711203730.GD6843@elf.ucw.cz> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Return-path: Received: from ogre.sisk.pl ([217.79.144.158]:60512 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751310AbYGKUnS (ORCPT ); Fri, 11 Jul 2008 16:43:18 -0400 In-Reply-To: <20080711203730.GD6843@elf.ucw.cz> Content-Disposition: inline Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: Pavel Machek Cc: Jesse Barnes , ACPI Devel Maling List , Alan Stern , Andi Kleen , pm list , Zhang Rui , Zhao Yakui On Friday, 11 of July 2008, Pavel Machek wrote: > Hi! > > > From: Rafael J. Wysocki > > > > PCI: Simplify PCI device PM code (rev. 4) > > > > If the offset of PCI device's PM capability in its configuration > > space, the mask of states that the device supports PME# from and the > > D1 and D2 support bits are cached in the corresponding > > struct pci_dev, the PCI device PM code can be simplified quite a bit. > > > > Signed-off-by: Rafael J. Wysocki > > --- > > drivers/pci/pci.c | 118 ++++++++++++++++++++--------------------------- > > include/linux/pci.h | 8 ++- > > include/linux/pci_regs.h | 1 > > 3 files changed, 60 insertions(+), 67 deletions(-) > > > > Index: linux-pci/include/linux/pci.h > > =================================================================== > > --- linux-pci.orig/include/linux/pci.h > > +++ linux-pci/include/linux/pci.h > > @@ -177,6 +177,13 @@ struct pci_dev { > > pci_power_t current_state; /* Current operating state. In ACPI-speak, > > this is D0-D3, D0 being fully functional, > > and D3 being off. */ > > + int pm_cap; /* PM capability offset in the > > + configuration space */ > > + unsigned int pme_support:5; /* Bitmask of states from which PME# > > + can be generated */ > > + unsigned int d1_support:1; /* Low power state D1 is supported */ > > + unsigned int d2_support:1; /* Low power state D2 is supported */ > > + unsigned int no_d1d2:1; /* Only allow D0 and D3 */ > > Uh, "D1", "D2", then "no D1D2" ? Yes. They are used for different things. > > } > > > > - if (pmc & PCI_PM_CAP_PME_MASK) { > > + dev->pm_cap = pm; > > + > > + dev->d1_support = false; > > + dev->d2_support = false; > > I thought d1_support is unsigned int, not bool? They are always used as bools, though. Thanks, Rafael