]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.18-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Jan 2018 14:03:53 +0000 (15:03 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Jan 2018 14:03:53 +0000 (15:03 +0100)
added patches:
input-do-not-emit-unneeded-ev_syn-when-suspending.patch

queue-3.18/input-do-not-emit-unneeded-ev_syn-when-suspending.patch [new file with mode: 0644]
queue-3.18/series [new file with mode: 0644]

diff --git a/queue-3.18/input-do-not-emit-unneeded-ev_syn-when-suspending.patch b/queue-3.18/input-do-not-emit-unneeded-ev_syn-when-suspending.patch
new file mode 100644 (file)
index 0000000..13dae5a
--- /dev/null
@@ -0,0 +1,44 @@
+From 00159f19a5057cb779146afce1cceede692af346 Mon Sep 17 00:00:00 2001
+From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Date: Thu, 6 Aug 2015 19:15:30 -0700
+Subject: Input: do not emit unneeded EV_SYN when suspending
+
+From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+
+commit 00159f19a5057cb779146afce1cceede692af346 upstream.
+
+Do not emit EV_SYN/SYN_REPORT on suspend if there were no keys that are
+still pressed as we are suspending the device (and in all other cases when
+input core is forcibly releasing keys via input_dev_release_keys() call).
+
+Reviewed-by: Benson Leung <bleung@chromium.org>
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Bo Hu <bohu@google.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+diff --git a/drivers/input/input.c b/drivers/input/input.c
+index 78d24990a816..5391abd28b27 100644
+--- a/drivers/input/input.c
++++ b/drivers/input/input.c
+@@ -674,13 +674,19 @@ EXPORT_SYMBOL(input_close_device);
+  */
+ static void input_dev_release_keys(struct input_dev *dev)
+ {
++      bool need_sync = false;
+       int code;
+       if (is_event_supported(EV_KEY, dev->evbit, EV_MAX)) {
+-              for_each_set_bit(code, dev->key, KEY_CNT)
++              for_each_set_bit(code, dev->key, KEY_CNT) {
+                       input_pass_event(dev, EV_KEY, code, 0);
++                      need_sync = true;
++              }
++
++              if (need_sync)
++                      input_pass_event(dev, EV_SYN, SYN_REPORT, 1);
++
+               memset(dev->key, 0, sizeof(dev->key));
+-              input_pass_event(dev, EV_SYN, SYN_REPORT, 1);
+       }
+ }
diff --git a/queue-3.18/series b/queue-3.18/series
new file mode 100644 (file)
index 0000000..4532d9d
--- /dev/null
@@ -0,0 +1 @@
+input-do-not-emit-unneeded-ev_syn-when-suspending.patch