Input: i8042 - signal wakeup from atkbd/psmouse
Subsystems (2)
Dmitry Torokhov
maintainerPATCH 1/1 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.
Signed-off-by Dmitry Torokhov <[email protected]>
--- 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(-)
drivers/input/keyboard/atkbd.c +2 -0
@@ -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;
drivers/input/mouse/psmouse-base.c +2 -0
@@ -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;
drivers/input/serio/i8042.c +0 -3
@@ -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" : "",
Signature · 5 lines
2.21.0.392.gf8f6787159e-goog -- Dmitry
Quoted 7 lines · CET Dmitry Torokhov
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 <[email protected]>
LGTM:
Quoted 47 lines
--- 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(-)drivers/input/keyboard/atkbd.c +2
-0@@ -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;drivers/input/mouse/psmouse-base.c +2
-0@@ -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;drivers/input/serio/i8042.c +0
-3@@ -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" : "",