public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthew Garrett <mjg59@srcf.ucam.org>
To: Shaohua Li <shaohua.li@intel.com>
Cc: linux acpi <linux-acpi@vger.kernel.org>,
	linux-pm <linux-pm@lists.osdl.org>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	Alan Stern <stern@rowland.harvard.edu>
Subject: Re: [PATCH 4/5]PCIe native PME support
Date: Wed, 19 Aug 2009 12:58:11 +0100	[thread overview]
Message-ID: <20090819115811.GD12216@srcf.ucam.org> (raw)
In-Reply-To: <1250666659.23178.119.camel@sli10-desk.sh.intel.com>

On Wed, Aug 19, 2009 at 03:24:19PM +0800, Shaohua Li wrote:

> +static inline void npme_enable_pme(struct pci_dev *pdev, bool enable)
> +{
> +	int pos;
> +	u16 rtctl;
> +
> +	pos = pci_find_capability(pdev, PCI_CAP_ID_EXP);
> +
> +	pci_read_config_word(pdev, pos + PCI_EXP_RTCTL, &rtctl);
> +	if (!enable)
> +		rtctl &= ~PCI_EXP_RTCTL_PMEIE;
> +	else
> +		rtctl |= PCI_EXP_RTCTL_PMEIE;
> +	pci_write_config_word(pdev, pos + PCI_EXP_RTCTL, rtctl);
> +}

This seems to duplicate the existing pci_pme_active() function?

> +static inline void npme_clear_pme(struct pci_dev *pdev)
> +{
> +	int pos;
> +	u32 rtsta;
> +
> +	pos = pci_find_capability(pdev, PCI_CAP_ID_EXP);
> +
> +	pci_read_config_dword(pdev, pos + PCI_EXP_RTSTA, &rtsta);
> +	rtsta |= PCI_EXP_RTSTA_PME;
> +	pci_write_config_dword(pdev, pos + PCI_EXP_RTSTA, rtsta);
> +}

Ditto.

> +static bool npme_pme_target(struct pci_dev *target)
> +{
> +	bool ret = false;
> +	if (target->dev.bus->pm && target->dev.bus->pm->wakeup_event)
> +		ret = target->dev.bus->pm->wakeup_event(&target->dev);
> +	return ret;
> +}

Is there any situation in which we wouldn't want to just perform a 
runtime resume of the device here?

-- 
Matthew Garrett | mjg59@srcf.ucam.org

  reply	other threads:[~2009-08-19 11:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-19  7:24 [PATCH 4/5]PCIe native PME support Shaohua Li
2009-08-19 11:58 ` Matthew Garrett [this message]
2009-08-20  3:10   ` Shaohua Li
2009-08-20 20:07     ` Rafael J. Wysocki
2009-08-20 21:22 ` Rafael J. Wysocki
     [not found] ` <200908202322.02588.rjw@sisk.pl>
2009-08-21  7:01   ` Shaohua Li
     [not found]   ` <20090821070112.GC16694@sli10-desk.sh.intel.com>
2009-08-21 16:47     ` 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=20090819115811.GD12216@srcf.ucam.org \
    --to=mjg59@srcf.ucam.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-pm@lists.osdl.org \
    --cc=rjw@sisk.pl \
    --cc=shaohua.li@intel.com \
    --cc=stern@rowland.harvard.edu \
    /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