On Wed, 25 Jun 2008, Rafael J. Wysocki wrote: > Index: linux-2.6/drivers/pci/pci.c > =================================================================== > --- linux-2.6.orig/drivers/pci/pci.c > +++ linux-2.6/drivers/pci/pci.c > +/** > + * pci_pme_active - enable or disable PCI device's PME# function > + * @dev: PCI device to handle. > + * @pm: PCI PM capability offset of the device. > + * @enable: 'true' to enable PME# generation; 'false' to disable it. > + * > + * The caller must verify that the device is capable of generating PME# before > + * calling this function with @enable equal to 'true'. > + */ > +static void pci_pme_active(struct pci_dev *dev, int pm, bool enable) > +{ > + u16 pmcsr; > + > + if (!pm) > + return; > + > + pci_read_config_word(dev, pm + PCI_PM_CTRL, &pmcsr); > + /* Clear PME_Status by writing 1 to it and enable PME# */ > + pmcsr |= PCI_PM_CTRL_PME_STATUS | PCI_PM_CTRL_PME_ENABLE; > + if (!enable) > + pmcsr &= ~PCI_PM_CTRL_PME_ENABLE; > + > + pci_write_config_word(dev, pm + PCI_PM_CTRL, pmcsr); > +} Question: Does the PME Status ever get cleared at any other times? For instance, suppose a PCI device does use PME# to wake up the system. Does its status get cleared? Or suppose a PCI device is runtime-suspended and it generates a wakeup request? This will turn on PME# at a time when the system isn't asleep -- what happens then? Does it get lost somewhere in the bowels of ACPI? Does the PCI core need new code to handle such things? Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html