From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Nir Perry <nirperry@gmail.com>,
Masaki Ota <masaki.ota@jp.alps.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>
Subject: [PATCH 4.14 50/89] Input: ALPS - fix multi-touch decoding on SS4 plus touchpads
Date: Mon, 22 Jan 2018 09:45:30 +0100 [thread overview]
Message-ID: <20180122083959.715282898@linuxfoundation.org> (raw)
In-Reply-To: <20180122083954.683903493@linuxfoundation.org>
4.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nir Perry <nirperry@gmail.com>
commit 4d94e776bd29670f01befa27e12df784fa05fa2e upstream.
The fix for handling two-finger scroll (i4a646580f793 - "Input: ALPS -
fix two-finger scroll breakage in right side on ALPS touchpad")
introduced a minor "typo" that broke decoding of multi-touch events are
decoded on some ALPS touchpads. For example, tapping with three-fingers
can no longer be used to emulate middle-mouse-button (the kernel doesn't
recognize this as the proper event, and doesn't report it correctly to
userspace). This affects touchpads that use SS4 "plus" protocol
variant, like those found on Dell E7270 & E7470 laptops (tested on
E7270).
First, probably the code in alps_decode_ss4_v2() for case
SS4_PACKET_ID_MULTI used inconsistent indices to "f->mt[]". You can see
0 & 1 are used for the "if" part but 2 & 3 are used for the "else" part.
Second, in the previous patch, new macros were introduced to decode X
coordinates specific to the SS4 "plus" variant, but the macro to
define the maximum X value wasn't changed accordingly. The macros to
decode X values for "plus" variant are effectively shifted right by 1
bit, but the max wasn't shifted too. This causes the driver to
incorrectly handle "no data" cases, which also interfered with how
multi-touch was handled.
Fixes: 4a646580f793 ("Input: ALPS - fix two-finger scroll breakage...")
Signed-off-by: Nir Perry <nirperry@gmail.com>
Reviewed-by: Masaki Ota <masaki.ota@jp.alps.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/input/mouse/alps.c | 23 +++++++++++++----------
drivers/input/mouse/alps.h | 10 ++++++----
2 files changed, 19 insertions(+), 14 deletions(-)
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -1250,29 +1250,32 @@ static int alps_decode_ss4_v2(struct alp
case SS4_PACKET_ID_MULTI:
if (priv->flags & ALPS_BUTTONPAD) {
if (IS_SS4PLUS_DEV(priv->dev_id)) {
- f->mt[0].x = SS4_PLUS_BTL_MF_X_V2(p, 0);
- f->mt[1].x = SS4_PLUS_BTL_MF_X_V2(p, 1);
+ f->mt[2].x = SS4_PLUS_BTL_MF_X_V2(p, 0);
+ f->mt[3].x = SS4_PLUS_BTL_MF_X_V2(p, 1);
+ no_data_x = SS4_PLUS_MFPACKET_NO_AX_BL;
} else {
f->mt[2].x = SS4_BTL_MF_X_V2(p, 0);
f->mt[3].x = SS4_BTL_MF_X_V2(p, 1);
+ no_data_x = SS4_MFPACKET_NO_AX_BL;
}
+ no_data_y = SS4_MFPACKET_NO_AY_BL;
f->mt[2].y = SS4_BTL_MF_Y_V2(p, 0);
f->mt[3].y = SS4_BTL_MF_Y_V2(p, 1);
- no_data_x = SS4_MFPACKET_NO_AX_BL;
- no_data_y = SS4_MFPACKET_NO_AY_BL;
} else {
if (IS_SS4PLUS_DEV(priv->dev_id)) {
- f->mt[0].x = SS4_PLUS_STD_MF_X_V2(p, 0);
- f->mt[1].x = SS4_PLUS_STD_MF_X_V2(p, 1);
+ f->mt[2].x = SS4_PLUS_STD_MF_X_V2(p, 0);
+ f->mt[3].x = SS4_PLUS_STD_MF_X_V2(p, 1);
+ no_data_x = SS4_PLUS_MFPACKET_NO_AX;
} else {
- f->mt[0].x = SS4_STD_MF_X_V2(p, 0);
- f->mt[1].x = SS4_STD_MF_X_V2(p, 1);
+ f->mt[2].x = SS4_STD_MF_X_V2(p, 0);
+ f->mt[3].x = SS4_STD_MF_X_V2(p, 1);
+ no_data_x = SS4_MFPACKET_NO_AX;
}
+ no_data_y = SS4_MFPACKET_NO_AY;
+
f->mt[2].y = SS4_STD_MF_Y_V2(p, 0);
f->mt[3].y = SS4_STD_MF_Y_V2(p, 1);
- no_data_x = SS4_MFPACKET_NO_AX;
- no_data_y = SS4_MFPACKET_NO_AY;
}
f->first_mp = 0;
--- a/drivers/input/mouse/alps.h
+++ b/drivers/input/mouse/alps.h
@@ -141,10 +141,12 @@ enum SS4_PACKET_ID {
#define SS4_TS_Z_V2(_b) (s8)(_b[4] & 0x7F)
-#define SS4_MFPACKET_NO_AX 8160 /* X-Coordinate value */
-#define SS4_MFPACKET_NO_AY 4080 /* Y-Coordinate value */
-#define SS4_MFPACKET_NO_AX_BL 8176 /* Buttonless X-Coordinate value */
-#define SS4_MFPACKET_NO_AY_BL 4088 /* Buttonless Y-Coordinate value */
+#define SS4_MFPACKET_NO_AX 8160 /* X-Coordinate value */
+#define SS4_MFPACKET_NO_AY 4080 /* Y-Coordinate value */
+#define SS4_MFPACKET_NO_AX_BL 8176 /* Buttonless X-Coord value */
+#define SS4_MFPACKET_NO_AY_BL 4088 /* Buttonless Y-Coord value */
+#define SS4_PLUS_MFPACKET_NO_AX 4080 /* SS4 PLUS, X */
+#define SS4_PLUS_MFPACKET_NO_AX_BL 4088 /* Buttonless SS4 PLUS, X */
/*
* enum V7_PACKET_ID - defines the packet type for V7
next prev parent reply other threads:[~2018-01-22 8:45 UTC|newest]
Thread overview: 107+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-22 8:44 [PATCH 4.14 00/89] 4.14.15-stable review Greg Kroah-Hartman
2018-01-22 8:44 ` [PATCH 4.14 01/89] tools/objtool/Makefile: dont assume sync-check.sh is executable Greg Kroah-Hartman
2018-01-22 8:44 ` [PATCH 4.14 02/89] drm/nouveau/disp/gf119: add missing drive vfunc ptr Greg Kroah-Hartman
2018-01-22 8:44 ` [PATCH 4.14 03/89] objtool: Fix seg fault with clang-compiled objects Greg Kroah-Hartman
2018-01-22 8:44 ` [PATCH 4.14 04/89] objtool: Fix Clang enum conversion warning Greg Kroah-Hartman
2018-01-22 8:44 ` [PATCH 4.14 05/89] objtool: Fix seg fault caused by missing parameter Greg Kroah-Hartman
2018-01-22 8:44 ` [PATCH 4.14 06/89] powerpc/pseries: Add H_GET_CPU_CHARACTERISTICS flags & wrapper Greg Kroah-Hartman
2018-01-22 8:44 ` [PATCH 4.14 07/89] powerpc/64: Add macros for annotating the destination of rfid/hrfid Greg Kroah-Hartman
2018-01-22 8:44 ` [PATCH 4.14 08/89] powerpc/64s: Simple RFI macro conversions Greg Kroah-Hartman
2018-01-22 8:44 ` [PATCH 4.14 09/89] powerpc/64: Convert the syscall exit path to use RFI_TO_USER/KERNEL Greg Kroah-Hartman
2018-01-22 8:44 ` [PATCH 4.14 10/89] powerpc/64: Convert fast_exception_return " Greg Kroah-Hartman
2018-01-22 8:44 ` [PATCH 4.14 11/89] powerpc/64s: Convert slb_miss_common " Greg Kroah-Hartman
2018-01-22 8:44 ` [PATCH 4.14 12/89] powerpc/64s: Add support for RFI flush of L1-D cache Greg Kroah-Hartman
2018-01-22 8:44 ` [PATCH 4.14 13/89] powerpc/64s: Support disabling RFI flush with no_rfi_flush and nopti Greg Kroah-Hartman
2018-01-22 8:44 ` [PATCH 4.14 14/89] powerpc/pseries: Query hypervisor for RFI flush settings Greg Kroah-Hartman
2018-01-22 8:44 ` [PATCH 4.14 15/89] powerpc/powernv: Check device-tree " Greg Kroah-Hartman
2018-01-22 8:44 ` [PATCH 4.14 16/89] futex: Avoid violating the 10th rule of futex Greg Kroah-Hartman
2018-01-22 9:48 ` Geert Uytterhoeven
2018-01-22 9:53 ` Greg Kroah-Hartman
2018-01-22 10:04 ` Geert Uytterhoeven
2018-01-22 8:44 ` [PATCH 4.14 17/89] futex: Prevent overflow by strengthen input validation Greg Kroah-Hartman
2018-01-25 13:45 ` Jiri Slaby
2018-01-25 14:03 ` Thomas Gleixner
2018-01-25 14:06 ` Jiri Slaby
2018-01-25 14:30 ` Thomas Gleixner
2018-01-25 14:47 ` Jiri Slaby
2018-01-25 15:12 ` Greg Kroah-Hartman
2018-01-25 15:21 ` Jiri Slaby
2018-01-25 15:30 ` Peter Zijlstra
2018-01-25 21:42 ` Darren Hart
2018-01-22 8:44 ` [PATCH 4.14 18/89] ALSA: seq: Make ioctls race-free Greg Kroah-Hartman
2018-01-22 8:44 ` [PATCH 4.14 19/89] ALSA: pcm: Remove yet superfluous WARN_ON() Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 20/89] ALSA: hda - Apply headphone noise quirk for another Dell XPS 13 variant Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 21/89] ALSA: hda - Apply the existing quirk to iMac 14,1 Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 22/89] IB/hfi1: Prevent a NULL dereference Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 23/89] RDMA/mlx5: Fix out-of-bound access while querying AH Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 24/89] timers: Unconditionally check deferrable base Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 25/89] af_key: fix buffer overread in verify_address_len() Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 26/89] af_key: fix buffer overread in parse_exthdrs() Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 27/89] iser-target: Fix possible use-after-free in connection establishment error Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 28/89] delayacct: Account blkio completion on the correct task Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 29/89] objtool: Fix seg fault with gold linker Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 30/89] mmc: sdhci-esdhc-imx: Fix i.MX53 eSDHCv3 clock Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 31/89] x86/kasan: Panic if there is not enough memory to boot Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 32/89] x86/retpoline: Fill RSB on context switch for affected CPUs Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 33/89] x86/retpoline: Add LFENCE to the retpoline/RSB filling RSB macros Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 34/89] objtool: Improve error message for bad file argument Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 35/89] x86/cpufeature: Move processor tracing out of scattered features Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 36/89] module: Add retpoline tag to VERMAGIC Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 37/89] x86/intel_rdt/cqm: Prevent use after free Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 38/89] x86/mm/pkeys: Fix fill_sig_info_pkey Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 39/89] x86/idt: Mark IDT tables __initconst Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 40/89] x86/tsc: Future-proof native_calibrate_tsc() Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 41/89] x86/tsc: Fix erroneous TSC rate on Skylake Xeon Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 42/89] pipe: avoid round_pipe_size() nr_pages overflow on 32-bit Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 43/89] x86/apic/vector: Fix off by one in error path Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 44/89] x86/mm: Clean up register saving in the __enc_copy() assembly code Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 45/89] x86/mm: Use a struct to reduce parameters for SME PGD mapping Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 46/89] x86/mm: Centralize PMD flags in sme_encrypt_kernel() Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 47/89] x86/mm: Prepare sme_encrypt_kernel() for PAGE aligned encryption Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 48/89] ARM: OMAP3: hwmod_data: add missing module_offs for MMC3 Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 49/89] x86/mm: Encrypt the initrd earlier for BSP microcode update Greg Kroah-Hartman
2018-01-22 8:45 ` Greg Kroah-Hartman [this message]
2018-01-22 8:45 ` [PATCH 4.14 51/89] Input: synaptics-rmi4 - prevent UAF reported by KASAN Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 52/89] Input: 88pm860x-ts - fix child-node lookup Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 53/89] Input: twl6040-vibra " Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 54/89] Input: twl4030-vibra - fix sibling-node lookup Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 55/89] tracing: Fix converting enums from the map in trace_event_eval_update() Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 56/89] phy: work around phys references to usb-nop-xceiv devices Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 57/89] ARM64: dts: marvell: armada-cp110: Fix clock resources for various node Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 58/89] ARM: sunxi_defconfig: Enable CMA Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 59/89] ARM: dts: kirkwood: fix pin-muxing of MPP7 on OpenBlocks A7 Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 60/89] can: peak: fix potential bug in packet fragmentation Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 61/89] can: af_can: can_rcv(): replace WARN_ONCE by pr_warn_once Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 62/89] can: af_can: canfd_rcv(): " Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 63/89] i2c: core-smbus: prevent stack corruption on read I2C_BLOCK_DATA Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 64/89] scripts/gdb/linux/tasks.py: fix get_thread_info Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 65/89] proc: fix coredump vs read /proc/*/stat race Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 66/89] libata: apply MAX_SEC_1024 to all LITEON EP1 series devices Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 67/89] scsi: libsas: Disable asynchronous aborts for SATA devices Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 68/89] workqueue: avoid hard lockups in show_workqueue_state() Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 69/89] drm/vmwgfx: fix memory corruption with legacy/sou connectors Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 70/89] dm btree: fix serious bug in btree_split_beneath() Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 71/89] dm thin metadata: THIN_MAX_CONCURRENT_LOCKS should be 6 Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 72/89] dm integrity: dont store cipher request on the stack Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 73/89] dm crypt: fix crash by adding missing check for auth key size Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 74/89] dm crypt: wipe kernel key copy after IV initialization Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 75/89] dm crypt: fix error return code in crypt_ctr() Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 76/89] x86: Use __nostackprotect for sme_encrypt_kernel Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 77/89] alpha/PCI: Fix noname IRQ level detection Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 78/89] MIPS: CM: Drop WARN_ON(vp != 0) Greg Kroah-Hartman
2018-01-22 8:45 ` [PATCH 4.14 79/89] KVM: arm/arm64: Check pagesize when allocating a hugepage at Stage 2 Greg Kroah-Hartman
2018-01-22 8:46 ` [PATCH 4.14 80/89] arm64: KVM: Fix SMCCC handling of unimplemented SMC/HVC calls Greg Kroah-Hartman
2018-01-22 8:46 ` [PATCH 4.14 81/89] x86/mce: Make machine check speculation protected Greg Kroah-Hartman
2018-01-22 8:46 ` [PATCH 4.14 82/89] retpoline: Introduce start/end markers of indirect thunk Greg Kroah-Hartman
2018-01-22 8:46 ` [PATCH 4.14 83/89] kprobes/x86: Blacklist indirect thunk functions for kprobes Greg Kroah-Hartman
2018-01-22 8:46 ` [PATCH 4.14 84/89] kprobes/x86: Disable optimizing on the function jumps to indirect thunk Greg Kroah-Hartman
2018-01-22 8:46 ` [PATCH 4.14 85/89] x86/pti: Document fix wrong index Greg Kroah-Hartman
2018-01-22 8:46 ` [PATCH 4.14 86/89] x86/retpoline: Optimize inline assembler for vmexit_fill_RSB Greg Kroah-Hartman
2018-01-22 8:46 ` [PATCH 4.14 87/89] x86/mm: Rework wbinvd, hlt operation in stop_this_cpu() Greg Kroah-Hartman
2018-01-22 8:46 ` [PATCH 4.14 88/89] mm, page_vma_mapped: Drop faulty pointer arithmetics in check_pte() Greg Kroah-Hartman
2018-01-22 8:46 ` [PATCH 4.14 89/89] net: mvpp2: do not disable GMAC padding Greg Kroah-Hartman
2018-01-22 19:10 ` [PATCH 4.14 00/89] 4.14.15-stable review Guenter Roeck
2018-01-23 6:36 ` Greg Kroah-Hartman
2018-01-22 20:39 ` Naresh Kamboju
2018-01-22 21:00 ` Shuah Khan
2018-01-23 0:08 ` kernelci.org bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180122083959.715282898@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=masaki.ota@jp.alps.com \
--cc=nirperry@gmail.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).