lkml.org 
[lkml]   [2014]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] PCI / PM: Make PCIe PME interrupts wake up from "freeze" sleep state
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

This will not work on my machine, because aerdrv is requesting the same
irq.

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.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2014-07-24 16:22    [W:0.066 / U:0.088 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site