From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Zhao Yakui <yakui.zhao@intel.com>,
Zhang Rui <rui.zhang@intel.com>,
ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
Jesse Barnes <jbarnes@virtuousgeek.org>,
Len Brown <lenb@kernel.org>,
pm list <linux-pm@lists.linux-foundation.org>
Subject: Re: [RFC][PATCH 6/9] PCI ACPI: Introduce acpi_pm_device_sleep_wake function
Date: Thu, 26 Jun 2008 20:21:48 +0200 [thread overview]
Message-ID: <200806262021.49815.rjw@sisk.pl> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0806261008230.2811-100000@iolanthe.rowland.org>
On Thursday, 26 of June 2008, Alan Stern wrote:
> 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?
Currently, PME# status is only cleared when executing pci_pme_active() (for
example via pci_enable_wake()).
> For instance, suppose a PCI device does use PME# to wake up the system.
> Does its status get cleared?
If the driver of the device executes pci_enable_wake(dev, PCI_D0, false) during
resume, then the PME# status will be cleared.
Do you think the core should clear PME# status automatically in that case?
> 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?
Currently, yes, AFAICS.
> Does the PCI core need new code to handle such things?
Well, I thought of adding such things like the clearing of PME# status to the
PCI bus type suspend/resume callbacks.
Apart from this, I think that to implement PCI runtime PM we'll need to add
some new code. First of all, we need to handle the case when some devices are
in low power states before suspend/hibernation. Second, we need to handle PME#
generated by devices being in low power states (or even in D0) at run time and
that will certainly require new code.
Thanks,
Rafael
next prev parent reply other threads:[~2008-06-26 18:20 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-19 23:45 [RFC][PATCH 0/9] PCI PM: Rework PCI device PM Rafael J. Wysocki
2008-06-19 23:46 ` [RFC][PATCH 1/9] ACPI: Introduce acpi_bus_power_manageable function Rafael J. Wysocki
2008-06-24 12:25 ` [linux-pm] " Pavel Machek
2008-06-19 23:47 ` [RFC][PATCH 2/9] PCI: Introduce platform_pci_power_manageable function Rafael J. Wysocki
2008-06-24 12:31 ` [linux-pm] " Pavel Machek
2008-06-19 23:48 ` [RFC][PATCH 3/9] PCI: Rework pci_set_power_state function Rafael J. Wysocki
2008-06-24 12:34 ` [linux-pm] " Pavel Machek
2008-06-19 23:49 ` [RFC][PATCH 4/9] ACPI: Introduce acpi_device_sleep_wake function Rafael J. Wysocki
2008-06-24 12:38 ` [linux-pm] " Pavel Machek
2008-06-19 23:50 ` [RFC][PATCH 5/9] ACPI: Introduce new device wakeup flag 'prepared' Rafael J. Wysocki
2008-06-19 23:51 ` [RFC][PATCH 6/9] PCI ACPI: Introduce acpi_pm_device_sleep_wake function Rafael J. Wysocki
2008-06-25 8:11 ` Zhang Rui
2008-06-25 10:29 ` Zhao Yakui
2008-06-25 18:57 ` Rafael J. Wysocki
2008-06-25 21:31 ` Rafael J. Wysocki
2008-06-26 14:12 ` Alan Stern
2008-06-26 18:21 ` Rafael J. Wysocki [this message]
2008-06-26 19:54 ` Alan Stern
2008-06-26 20:31 ` Rafael J. Wysocki
2008-06-26 20:38 ` Alan Stern
2008-06-19 23:52 ` [RFC][PATCH 7/9] PCI ACPI: Introduce can_wakeup platform callback Rafael J. Wysocki
2008-06-19 23:52 ` [RFC][PATCH 8/9] PCI PM: Rework device PM initialization Rafael J. Wysocki
2008-06-20 15:59 ` [RFC][PATCH 8/9] PCI PM: Rework device PM initialization (rev. 2) Rafael J. Wysocki
2008-06-20 16:07 ` [RFC][PATCH 8.5/9] PCI PM: Add diagnostic statements to PCI device PM initialization Rafael J. Wysocki
2008-06-19 23:57 ` [RFC][PATCH 9/9] PCI PM: Introduce pci_prepare_to_sleep and pci_back_from_sleep Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200806262021.49815.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=jbarnes@virtuousgeek.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=rui.zhang@intel.com \
--cc=stern@rowland.harvard.edu \
--cc=yakui.zhao@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox