Input: i8042 - signal wakeup from atkbd/psmouse
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 26 Mar 2019 21:27:42 +0000 (14:27 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 4 Apr 2019 18:51:26 +0000 (11:51 -0700)
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.

Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/keyboard/atkbd.c
drivers/input/mouse/psmouse-base.c
drivers/input/serio/i8042.c

index 850bb259c20ebbba2c68f7dd88c6cfb83c9192a1..3ad93e3e2f4c7efcad2c3902e32e93ea066bdaaa 100644 (file)
@@ -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;
 
index d3ff1fc09af712700507d05ac3548703e49173a1..94f7ca5ad0772a3ec367e0b326b740077eb36d03 100644 (file)
@@ -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;
 
index 95a78ccbd847035007bac3e5ea43e5ee04db35de..6462f1798fbb5ab5976e45071b085eb007d805ad 100644 (file)
@@ -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" : "",