linux-stable/drivers
Jason Gerecke 546e41ac99 HID: wacom: Reset expected and received contact counts at the same time
These two values go hand-in-hand and must be valid for the driver to
behave correctly. We are currently lazy about updating the values and
rely on the "expected" code flow to take care of making sure they're
valid at the point they're needed. The "expected" flow changed somewhat
with commit f8b6a74719 ("HID: wacom: generic: Support multiple tools
per report"), however. This led to problems with the DTH-2452 due (in
part) to *all* contacts being fully processed -- even those past the
expected contact count. Specifically, the received count gets reset to
0 once all expected fingers are processed, but not the expected count.
The rest of the contacts in the report are then *also* processed since
now the driver thinks we've only processed 0 of N expected contacts.

Later commits such as 7fb0413baa (HID: wacom: Use "Confidence" flag to
prevent reporting invalid contacts) worked around the DTH-2452 issue by
skipping the invalid contacts at the end of the report, but this is not
a complete fix. The confidence flag cannot be relied on when a contact
is removed (see the following patch), and dealing with that condition
re-introduces the DTH-2452 issue unless we also address this contact
count laziness. By resetting expected and received counts at the same
time we ensure the driver understands that there are 0 more contacts
expected in the report. Similarly, we also make sure to reset the
received count if for some reason we're out of sync in the pre-report
phase.

Link: https://github.com/linuxwacom/input-wacom/issues/288
Fixes: f8b6a74719 ("HID: wacom: generic: Support multiple tools per report")
CC: stable@vger.kernel.org
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Ping Cheng <ping.cheng@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2022-01-21 15:10:02 +01:00
..
accessibility
acpi Power management updates for 5.17-rc1 2022-01-10 20:34:00 -08:00
amba
android binder: fix async_free_space accounting for empty parcels 2021-12-21 11:07:34 +01:00
ata libata: if T_LENGTH is zero, dma direction should be DMA_NONE 2021-12-17 09:32:13 +09:00
atm
auxdisplay auxdisplay: charlcd: checking for pointer reference before dereferencing 2021-11-24 11:46:52 +01:00
base Device properties framework updates for 5.17-rc1 2022-01-10 20:48:19 -08:00
bcma pci-v5.16-changes 2021-11-06 14:36:12 -07:00
block xen/blkfront: harden blkfront against event channel storms 2021-12-16 08:24:08 +01:00
bluetooth Bluetooth: btqca: sequential validation 2022-01-07 08:32:55 +01:00
bus ARM: SoC driver updates for v5.17 2022-01-10 08:13:52 -08:00
cdrom
char Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2022-01-11 10:21:35 -08:00
clk drm for 5.17-rc1 2022-01-10 12:58:46 -08:00
clocksource clocksource/drivers/arm_arch_timer: Force inlining of erratum_set_next_event_generic() 2021-12-10 17:47:00 +01:00
comedi
connector
counter
cpufreq cpufreq: amd-pstate: Fix Kconfig dependencies for AMD P-State 2022-01-06 18:31:33 +01:00
cpuidle cpuidle: use default_groups in kobj_type 2022-01-05 18:31:17 +01:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2022-01-11 10:21:35 -08:00
cxl cxl for v5.16 2021-11-08 11:49:48 -08:00
dax
dca
devfreq PM / devfreq: Reduce log severity for informative message 2021-12-16 11:29:54 +09:00
dio
dma dmaengine: st_fdma: fix MODULE_ALIAS 2021-12-13 13:18:48 +05:30
dma-buf Linux 5.16-rc5 2021-12-14 10:24:28 +01:00
edac - Add support for version 3 of the Synopsys DDR controller to synopsys_edac 2022-01-10 11:45:23 -08:00
eisa
extcon
firewire
firmware ARM: SoC driver updates for v5.17 2022-01-10 08:13:52 -08:00
fpga
fsi
gnss
gpio gpio: gpio-aspeed-sgpio: Fix wrong hwirq base in irq handler 2022-01-03 10:50:12 +01:00
gpu Revert "drm/amd/display: Fix for otg synchronization logic" 2022-01-10 18:50:10 -08:00
greybus
hid HID: wacom: Reset expected and received contact counts at the same time 2022-01-21 15:10:02 +01:00
hsi
hv random: remove unused irq_flags argument from add_interrupt_randomness() 2022-01-07 00:25:25 +01:00
hwmon hwmon: (nzxt-smart2) make array detect_fans_report static const 2022-01-09 17:10:58 -08:00
hwspinlock
hwtracing
i2c ACPI updates for 5.17-rc1 2022-01-10 20:26:56 -08:00
i3c
idle
iio iio: trigger: stm32-timer: fix MODULE_ALIAS 2021-12-04 15:37:02 +00:00
infiniband Networking changes for 5.17. 2022-01-10 19:06:09 -08:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2022-01-09 10:49:12 -08:00
interconnect
iommu s390/pci: use physical addresses in DMA tables 2021-12-06 14:42:26 +01:00
ipack
irqchip irqchip/irq-bcm7120-l2: Add put_device() after of_find_device_by_node() 2021-12-10 13:23:13 +00:00
isdn Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-12-30 12:12:12 -08:00
leds
macintosh Merge branch 'akpm' (patches from Andrew) 2021-11-06 14:08:17 -07:00
mailbox
mcb
md block-5.16-2022-01-07 2022-01-07 13:28:20 -08:00
media media: ipu3-cio2: Add support for instantiating i2c-clients for VCMs 2021-12-16 20:58:56 +01:00
memory ARM: SoC driver updates for v5.17 2022-01-10 08:13:52 -08:00
memstick
message pci-v5.16-changes 2021-11-06 14:36:12 -07:00
mfd chrome platform changes for 5.16 2021-11-10 11:36:43 -08:00
misc Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-12-16 16:13:19 -08:00
mmc Power management updates for 5.17-rc1 2022-01-10 20:34:00 -08:00
most
mtd ARM: SoC driver updates for v5.17 2022-01-10 08:13:52 -08:00
mux
net Power management updates for 5.17-rc1 2022-01-10 20:34:00 -08:00
nfc nfc: st21nfca: remove redundant assignment to variable i 2021-12-30 17:26:58 -08:00
ntb
nubus
nvdimm libnvdimm for v5.16 2021-11-10 10:56:02 -08:00
nvme nvmet-tcp: fix possible list corruption for unexpected command failure 2021-12-08 16:36:58 +01:00
nvmem
of Merge drm/drm-next into drm-misc-next 2021-12-16 14:48:27 +01:00
opp
parisc
parport
pci Device properties framework updates for 5.17-rc1 2022-01-10 20:48:19 -08:00
pcmcia pcmcia: hide the MAC address helpers if !NET 2021-11-22 14:02:52 +00:00
perf drivers: perf: marvell_cn10k: fix an IS_ERR() vs NULL check 2022-01-04 13:58:17 +00:00
phy Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-12-16 16:13:19 -08:00
pinctrl SoC: Add support for StarFive JH7100 RISC-V SoC 2022-01-10 08:32:37 -08:00
platform media updates for v5.17-rc1 2022-01-10 18:55:43 -08:00
pnp
power power: reset: ltc2952: Fix use of floating point literals 2021-11-16 15:22:39 +01:00
powercap Merge back earlier power capping changes for v5.17 2021-12-27 16:51:12 +01:00
pps
ps3
ptp net: fix SOF_TIMESTAMPING_BIND_PHC to work with multiple sockets 2022-01-06 12:18:08 +00:00
pwm drm for 5.17-rc1 2022-01-10 12:58:46 -08:00
rapidio rapidio: avoid bogus __alloc_size warning 2021-11-06 13:30:33 -07:00
ras RAS/CEC: Remove a repeated 'an' in a comment 2021-12-11 11:55:27 +01:00
regulator - Remove Drivers 2021-11-08 12:07:52 -08:00
remoteproc
reset SoC: Add support for StarFive JH7100 RISC-V SoC 2022-01-10 08:32:37 -08:00
rpmsg remoteproc updates for v5.16 2021-11-10 09:07:26 -08:00
rtc RTC for 5.16 2021-11-12 11:44:31 -08:00
s390 Networking changes for 5.17. 2022-01-10 19:06:09 -08:00
sbus
scsi SCSI fixes on 20211231 2021-12-31 09:22:25 -08:00
sh
siox
slimbus
soc ARM: SoC devicetree changes for v5.17 2022-01-10 08:24:40 -08:00
soundwire
spi ARM: SoC driver updates for v5.17 2022-01-10 08:13:52 -08:00
spmi
ssb
staging Device properties framework updates for 5.17-rc1 2022-01-10 20:48:19 -08:00
target scsi: target: configfs: Delete unnecessary checks for NULL 2021-11-18 23:07:02 -05:00
tc
tee ARM: SoC driver updates for v5.17 2022-01-10 08:13:52 -08:00
thermal Thermal control updates for 5.17-rc1 2022-01-10 20:43:54 -08:00
thunderbolt
tty ACPI updates for 5.17-rc1 2022-01-10 20:26:56 -08:00
uio
usb ARM: SoC driver updates for v5.17 2022-01-10 08:13:52 -08:00
vdpa vdpa: Consider device id larger than 31 2021-12-08 15:41:50 -05:00
vfio vfio/pci: Fix OpRegion read 2021-11-30 11:41:49 -07:00
vhost vdpa: check that offsets are within bounds 2021-12-08 14:53:15 -05:00
video drm for 5.17-rc1 2022-01-10 12:58:46 -08:00
virt nitro_enclaves: Use get_user_pages_unlocked() call to handle mmap assert 2021-12-21 11:08:19 +01:00
virtio virtio_ring: Fix querying of maximum DMA mapping size for virtio device 2021-12-08 15:04:06 -05:00
visorbus
vlynq
vme
w1
watchdog linux-watchdog 5.16-rc1 tag 2021-11-10 09:41:22 -08:00
xen xen/console: harden hvc_xen against event channel storms 2021-12-16 08:24:08 +01:00
zorro
Kconfig
Makefile virtio: always enter drivers/virtio/ 2021-12-08 14:53:15 -05:00