linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org,
	Ravi Chandra Sadineni <ravisadineni@chromium.org>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Shaunak Saha <shaunak.saha@intel.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Input: i8042 - signal wakeup from atkbd/psmouse
Date: Thu, 28 Mar 2019 11:26:02 +0100	[thread overview]
Message-ID: <2013760.MOPEFL89cj@aspire.rjw.lan> (raw)
In-Reply-To: <20190327002800.GA187083@dtor-ws>

On Wednesday, March 27, 2019 1:28:00 AM CET Dmitry Torokhov wrote:
> Instead of signalling wakeup directly from i8042, let psmouse and atkbd
> drivers execute basic protocol handling and only then signal wakeup
> condition. This solves the issue where we increment wakeup counter
> simply because we are getting responses from keyboard/mouse to the
> commands we ourselves send to them as part of suspend transition.
> 
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

LGTM:

Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

> ---
>  drivers/input/keyboard/atkbd.c     | 2 ++
>  drivers/input/mouse/psmouse-base.c | 2 ++
>  drivers/input/serio/i8042.c        | 3 ---
>  3 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
> index 850bb259c20e..3ad93e3e2f4c 100644
> --- a/drivers/input/keyboard/atkbd.c
> +++ b/drivers/input/keyboard/atkbd.c
> @@ -401,6 +401,8 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
>  		if  (ps2_handle_response(&atkbd->ps2dev, data))
>  			goto out;
>  
> +	pm_wakeup_event(&serio->dev, 0);
> +
>  	if (!atkbd->enabled)
>  		goto out;
>  
> diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
> index d3ff1fc09af7..94f7ca5ad077 100644
> --- a/drivers/input/mouse/psmouse-base.c
> +++ b/drivers/input/mouse/psmouse-base.c
> @@ -373,6 +373,8 @@ static irqreturn_t psmouse_interrupt(struct serio *serio,
>  		if  (ps2_handle_response(&psmouse->ps2dev, data))
>  			goto out;
>  
> +	pm_wakeup_event(&serio->dev, 0);
> +
>  	if (psmouse->state <= PSMOUSE_RESYNCING)
>  		goto out;
>  
> diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
> index 95a78ccbd847..6462f1798fbb 100644
> --- a/drivers/input/serio/i8042.c
> +++ b/drivers/input/serio/i8042.c
> @@ -573,9 +573,6 @@ static irqreturn_t i8042_interrupt(int irq, void *dev_id)
>  	port = &i8042_ports[port_no];
>  	serio = port->exists ? port->serio : NULL;
>  
> -	if (irq && serio)
> -		pm_wakeup_event(&serio->dev, 0);
> -
>  	filter_dbg(port->driver_bound, data, "<- i8042 (interrupt, %d, %d%s%s)\n",
>  		   port_no, irq,
>  		   dfl & SERIO_PARITY ? ", bad parity" : "",
> 



      reply	other threads:[~2019-03-28 10:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-27  0:28 [PATCH] Input: i8042 - signal wakeup from atkbd/psmouse Dmitry Torokhov
2019-03-28 10:26 ` Rafael J. Wysocki [this message]

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=2013760.MOPEFL89cj@aspire.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=ravisadineni@chromium.org \
    --cc=shaunak.saha@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).