From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
Linux PCI <linux-pci@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux PM list <linux-pm@vger.kernel.org>
Subject: Re: [PATCH] PCI / PM: Make PCIe PME interrupts wake up from "freeze" sleep state
Date: Thu, 24 Jul 2014 17:01:02 +0200 [thread overview]
Message-ID: <2043223.I5LvKcR9SD@vostro.rjw.lan> (raw)
In-Reply-To: <20140724134241.GZ6758@twins.programming.kicks-ass.net>
[-- Attachment #1: Type: text/plain, Size: 3499 bytes --]
On Thursday, July 24, 2014 03:42:41 PM Peter Zijlstra wrote:
> On Wed, Jul 23, 2014 at 10:46:26PM +0200, Rafael J. Wysocki wrote:
> > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> >
> > The "freeze" sleep state, also known as suspend-to-idle, is entered
> > without taking nonboot CPUs offline, right after devices have been
> > suspended. It works by waiting for at least one wakeup source object
> > to become "active" as a result of handling a hardware interrupt.
> >
> > Of course, interrupts supposed to be able to wake up the system from
> > suspend-to-idle cannot be disabled by suspend_device_irqs() and their
> > interrupt handlers must be able to cope with interrupts coming after
> > all devices have been suspended. In that case, they only need to
> > call __pm_wakeup_event() for a single wakeup source object without
> > trying to access hardware (that will be resumed later as part of
> > the subsequent system resume).
> >
> > Make PCIe PME interrupts work this way.
> >
> > Register an additional wakeup source object for each PCIe PME
> > service device. That object will be used to generate wakeups from
> > suspend-to-idle.
> >
> > Add IRQF_NO_SUSPEND to PME interrupt flags. This will make
> > suspend_device_irqs() to ignore PME interrupts, but that's OK,
> > because the PME interrupt handler is suspend-aware anyway and
> > can cope with interrupts coming during system suspend-resume.
> >
> > For each PCIe port with PME service during the "prepare" phase of
> > system suspend walk the bus below it and see if any devices on that
> > bus are configured for wakeup. If so, mark the port as one that can
> > be used for system wakeup signaling and handle it differenty going
> > forward.
> >
> > Namely, while suspending its PME service, do not disable the PME
> > interrupt, but only set a "suspended" flag for the PME service to
> > make the interrupt handler behave in a special way, which is to call
> > __pm_wakeup_event() with the service's wakeup source object as the
> > first argument whenever the interrupt is triggered.
> >
> > The "suspended" flag is cleared while resuming the PME service and
> > the "wakeup" flag is cleared at the "complete" stage of system
> > resume.
> >
> > This change allows Wake-on-LAN to be used for wakeup from
> > suspend-to-idle on my MSI Wind tesbed netbook.
> >
> > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > ---
>
> > - ret = request_irq(srv->irq, pcie_pme_irq, IRQF_SHARED, "PCIe PME", srv);
> > + ret = request_irq(srv->irq, pcie_pme_irq, IRQF_SHARED | IRQF_NO_SUSPEND,
> > + "PCIe PME", srv);
>
> So with this patch on:
>
> http://marc.info/?l=linux-kernel&m=140620918218199
ACK for this one (already sent in that thread).
> This will not work on my machine, because aerdrv is requesting the same
> irq.
AER is PCIe error reporting service.
> Now I've not a f'cking clue what aerdrv is, and whether it too wants
> NO_SUSPEND on or not.
>
> But if I make it also request NO_SUSPEND it all starts working.
I think we should make all PCIe port services (there may be hotplug too)
use IRQF_NO_SUSPEND which will solve this particular problem, but there's
more to that (for example, ACPI SCI which in theory may be shared).
I guess it's time to revisit that thing, but that's a separate issue, of
course.
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2014-07-24 14:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-23 20:46 [PATCH] PCI / PM: Make PCIe PME interrupts wake up from "freeze" sleep state Rafael J. Wysocki
2014-07-24 13:42 ` Peter Zijlstra
2014-07-24 15:01 ` Rafael J. Wysocki [this message]
2014-07-24 15:36 ` Rafael J. Wysocki
2014-07-24 17:13 ` Peter Zijlstra
2014-07-27 23:08 ` 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=2043223.I5LvKcR9SD@vostro.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=bhelgaas@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=peterz@infradead.org \
/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