Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: i8042 - signal wakeup from atkbd/psmouse

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>

+4 -3
+2
drivers/input/keyboard/atkbd.c
··· 401 401 if (ps2_handle_response(&atkbd->ps2dev, data)) 402 402 goto out; 403 403 404 + pm_wakeup_event(&serio->dev, 0); 405 + 404 406 if (!atkbd->enabled) 405 407 goto out; 406 408
+2
drivers/input/mouse/psmouse-base.c
··· 373 373 if (ps2_handle_response(&psmouse->ps2dev, data)) 374 374 goto out; 375 375 376 + pm_wakeup_event(&serio->dev, 0); 377 + 376 378 if (psmouse->state <= PSMOUSE_RESYNCING) 377 379 goto out; 378 380
-3
drivers/input/serio/i8042.c
··· 573 573 port = &i8042_ports[port_no]; 574 574 serio = port->exists ? port->serio : NULL; 575 575 576 - if (irq && serio) 577 - pm_wakeup_event(&serio->dev, 0); 578 - 579 576 filter_dbg(port->driver_bound, data, "<- i8042 (interrupt, %d, %d%s%s)\n", 580 577 port_no, irq, 581 578 dfl & SERIO_PARITY ? ", bad parity" : "",