From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:36226 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752830AbeAaOD4 (ORCPT ); Wed, 31 Jan 2018 09:03:56 -0500 Subject: Patch "Input: do not emit unneeded EV_SYN when suspending" has been added to the 3.18-stable tree To: dmitry.torokhov@gmail.com, bleung@chromium.org, bohu@google.com, gregkh@linuxfoundation.org Cc: , From: Date: Wed, 31 Jan 2018 15:03:53 +0100 Message-ID: <1517407433181244@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled Input: do not emit unneeded EV_SYN when suspending to the 3.18-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: input-do-not-emit-unneeded-ev_syn-when-suspending.patch and it can be found in the queue-3.18 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From 00159f19a5057cb779146afce1cceede692af346 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Thu, 6 Aug 2015 19:15:30 -0700 Subject: Input: do not emit unneeded EV_SYN when suspending From: Dmitry Torokhov 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 Signed-off-by: Dmitry Torokhov Signed-off-by: Bo Hu Signed-off-by: Greg Kroah-Hartman 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); } } Patches currently in stable-queue which might be from dmitry.torokhov@gmail.com are queue-3.18/input-do-not-emit-unneeded-ev_syn-when-suspending.patch