lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Thu, 12 Oct 2017 17:18:08 -0700
From:   Rajat Jain <rajatja@...gle.com>
To:     Linux PM <linux-pm@...r.kernel.org>,
        "Wysocki, Rafael J" <rafael.j.wysocki@...el.com>,
        Dmitry Torokhov <dtor@...gle.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: Understanding the use cases for calling pm_wakeup_event()

[+lkml]

On Thu, Oct 12, 2017 at 5:13 PM, Rajat Jain <rajatja@...gle.com> wrote:
> Hi,
>
> I'm trying to understand when a driver is supposed to call the
> pm_wakeup_event(). It appears that the purpose of this call is to
>
> (1) In the suspend patch, halt the suspend if the driver believes it
> just got an appropriate wake event from the device while the system is
> trying to suspend.
>
> (2) If driver detects the event in the resume path, identify the
> device as (one of the) wake sources that fired.
>
> I understand good use cases of this call will be when a driver knows
> that its device has woken up the system, e.g:
>
> * When a driver handles dedicated "wakeup irq", and sees the interrupt fired.
> * If a driver detect operator events such as lid opened, power button
> pressed, switched to tablet mode etc etc.
>
> But what should a driver do, when it handles an event (in the resume
> path) that potentially was a wake up source but the driver is not
> sure? Is it appropriate to call
>
>        if (device_may_wakeup(dev))
>                 pm_wakeup_event(dev, 0);
>
> in that case, because I do see some drivers seem to call it when they
> think that their device *may* have been the reason the system woke up,
> but not necessarily *is* the reason for wake up. E.g.:
>
> drivers/input/mouse/cyapa.c:
> drivers/input/serio/hyperv-keyboard.c
> drivers/input/serio/olpc_apsp.c
>
> Thanks,
>
> Rajat

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ