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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 4 Jun 2018 14:53:39 -0700
From:   Dmitry Torokhov <dmitry.torokhov@...il.com>
To:     Ravi Chandra Sadineni <ravisadineni@...omium.org>,
        "Rafael J. Wysocki" <rafael@...nel.org>
Cc:     chenhong3@...wei.com, ravisadineni@...gle.com, dtor@...gle.com,
        tbroch@...gle.com, linux-kernel@...r.kernel.org,
        linux-input@...r.kernel.org, rajatja@...gle.com, bleung@...gle.com
Subject: Re: [PATCH V2] i8042: Increment wakeup_count for the respective port.

On Fri, Jun 01, 2018 at 06:07:08PM -0700, Ravi Chandra Sadineni wrote:
> Call pm_wakeup_event on every irq. This should help us in identifying if
> keyboard was a potential wake reason for the last resume.
> 
> Signed-off-by: Ravi Chandra Sadineni <ravisadineni@...omium.org>
> ---
> V2: Increment the wakeup count only when there is a irq and not when the
> method is called internally.
> 
> drivers/input/serio/i8042.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
> index 824f4c1c1f310..2bd6f2633e29a 100644
> --- a/drivers/input/serio/i8042.c
> +++ b/drivers/input/serio/i8042.c
> @@ -573,6 +573,9 @@ static irqreturn_t i8042_interrupt(int irq, void *dev_id)
>  	port = &i8042_ports[port_no];
>  	serio = port->exists ? port->serio : NULL;
>  
> +	if (irq && serio && device_may_wakeup(&serio->dev))
> +		pm_wakeup_event(&serio->dev, 0);

The constant checks for device_may_wakeup() before calling
pm_wakeup_event()needed to avoid warnings in wakeup_source_activate()
(?) are annoying. Rafael, can we move the check into
pm_wakeup_dev_event()?

I am also confused when pm_wakeup_event() vs pm_wakeup_hard_event() vs
pm_wakeup_dev_event() should be used, if any. Is there any guidance?

> +
>  	filter_dbg(port->driver_bound, data, "<- i8042 (interrupt, %d, %d%s%s)\n",
>  		   port_no, irq,
>  		   dfl & SERIO_PARITY ? ", bad parity" : "",
> -- 
> 2.17.1.1185.g55be947832-goog
> 

Thanks.

-- 
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ