2010-02-17 11:04:07

by Alan Jenkins

[permalink] [raw]
Subject: [PATCH] Input: serio - add thaw

633aae2 "Input: i8042 - switch to using dev_pm_ops"
removed handling for PMSG_THAW, causing obscure breakage.

It can break if you press keys during hibernation,
which causes subsequent keypresses to be lost -
so you can't cancel s2disk by pressing backspace -
and then just before system poweroff you get
"psmouse.c: Failed to deactivate mouse".

Apparently freeze/thaw doesn't need the heavyweight
enable/disable cycle. So we just need to check for
pending events at thaw time, by running the interrupt
handler.

Signed-off-by: Alan Jenkins <[email protected]>

diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index d84a36e..b54aee7 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -1161,9 +1161,17 @@ static int i8042_pm_restore(struct device *dev)
return 0;
}

+static int i8042_pm_thaw(struct device *dev)
+{
+ i8042_interrupt(0, NULL);
+
+ return 0;
+}
+
static const struct dev_pm_ops i8042_pm_ops = {
.suspend = i8042_pm_reset,
.resume = i8042_pm_restore,
+ .thaw = i8042_pm_thaw,
.poweroff = i8042_pm_reset,
.restore = i8042_pm_restore,
};