diff options
author | Salvatore Bonaccorso <carnil@debian.org> | 2021-11-12 22:55:06 +0100 |
---|---|---|
committer | Salvatore Bonaccorso <carnil@debian.org> | 2021-11-12 22:55:59 +0100 |
commit | 320925cd10636e7baddb05864d808488b71c88a9 (patch) | |
tree | 7d3e03ffea0513d5ff8a06d46008e67aa1084781 | |
parent | a648e9d2a0a4be55b2130db5cb745867d67a9730 (diff) | |
download | kernel_replicant_linux-320925cd10636e7baddb05864d808488b71c88a9.tar.gz kernel_replicant_linux-320925cd10636e7baddb05864d808488b71c88a9.tar.bz2 kernel_replicant_linux-320925cd10636e7baddb05864d808488b71c88a9.zip |
Input: elantench - fix misreporting trackpoint coordinates
Closes: #989285
-rw-r--r-- | debian/changelog | 1 | ||||
-rw-r--r-- | debian/patches/bugfix/all/Input-elantench-fix-misreporting-trackpoint-coordina.patch | 46 | ||||
-rw-r--r-- | debian/patches/series | 1 |
3 files changed, 48 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog index fadd17331148..ab6ea9acd07b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,7 @@ linux (5.15.2-1~exp1) UNRELEASED; urgency=medium * perf srcline: Use long-running addr2line per DSO (Closes: #911815) * Refresh "Export symbols needed by Android drivers" * [rt] Update to 5.15.2-rt19 + * Input: elantench - fix misreporting trackpoint coordinates (Closes: #989285) [ Vincent Blut ] * [x86] drivers/ptp: Enable PTP_1588_CLOCK_VMW as module diff --git a/debian/patches/bugfix/all/Input-elantench-fix-misreporting-trackpoint-coordina.patch b/debian/patches/bugfix/all/Input-elantench-fix-misreporting-trackpoint-coordina.patch new file mode 100644 index 000000000000..766ec3b23da2 --- /dev/null +++ b/debian/patches/bugfix/all/Input-elantench-fix-misreporting-trackpoint-coordina.patch @@ -0,0 +1,46 @@ +From: Phoenix Huang <phoenix@emc.com.tw> +Date: Sun, 7 Nov 2021 22:00:03 -0800 +Subject: Input: elantench - fix misreporting trackpoint coordinates +Origin: https://git.kernel.org/linus/be896bd3b72b44126c55768f14c22a8729b0992e +Bug-Debian: https://bugs.debian.org/989285 + +Some firmwares occasionally report bogus data from trackpoint, with X or Y +displacement being too large (outside of [-127, 127] range). Let's drop such +packets so that we do not generate jumps. + +Signed-off-by: Phoenix Huang <phoenix@emc.com.tw> +Tested-by: Yufei Du <yufeidu@cs.unc.edu> +Link: https://lore.kernel.org/r/20210729010940.5752-1-phoenix@emc.com.tw +Cc: stable@vger.kernel.org +Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> +--- + drivers/input/mouse/elantech.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c +index 2d0bc029619f..956d9cd34796 100644 +--- a/drivers/input/mouse/elantech.c ++++ b/drivers/input/mouse/elantech.c +@@ -517,6 +517,19 @@ static void elantech_report_trackpoint(struct psmouse *psmouse, + case 0x16008020U: + case 0x26800010U: + case 0x36808000U: ++ ++ /* ++ * This firmware misreport coordinates for trackpoint ++ * occasionally. Discard packets outside of [-127, 127] range ++ * to prevent cursor jumps. ++ */ ++ if (packet[4] == 0x80 || packet[5] == 0x80 || ++ packet[1] >> 7 == packet[4] >> 7 || ++ packet[2] >> 7 == packet[5] >> 7) { ++ elantech_debug("discarding packet [%6ph]\n", packet); ++ break; ++ ++ } + x = packet[4] - (int)((packet[1]^0x80) << 1); + y = (int)((packet[2]^0x80) << 1) - packet[5]; + +-- +2.33.1 + diff --git a/debian/patches/series b/debian/patches/series index 3f295f13d506..81eeb8bd4077 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -90,6 +90,7 @@ bugfix/all/disable-some-marvell-phys.patch bugfix/all/fs-add-module_softdep-declarations-for-hard-coded-cr.patch bugfix/all/media-ir-kbd-i2c-improve-responsiveness-of-hauppauge.patch bugfix/all/media-ite-cir-IR-receiver-stop-working-after-receive.patch +bugfix/all/Input-elantench-fix-misreporting-trackpoint-coordina.patch # Miscellaneous features |