Re: [RFC][PATCH 6/9] PCI ACPI: Introduce acpi_pm_device_sleep_wake function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

_______________________________________________
linux-pm mailing list
linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/linux-pm

[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux