Star64_linux/drivers
Grant Likely 4f57cace81 HID: input: Fix devices that return multiple bytes in battery report
Some devices, particularly the 3DConnexion Spacemouse wireless 3D
controllers, return more than just the battery capacity in the battery
report. The Spacemouse devices return an additional byte with a device
specific field. However, hidinput_query_battery_capacity() only
requests a 2 byte transfer.

When a spacemouse is connected via USB (direct wire, no wireless dongle)
and it returns a 3 byte report instead of the assumed 2 byte battery
report the larger transfer confuses and frightens the USB subsystem
which chooses to ignore the transfer. Then after 2 seconds assume the
device has stopped responding and reset it. This can be reproduced
easily by using a wired connection with a wireless spacemouse. The
Spacemouse will enter a loop of resetting every 2 seconds which can be
observed in dmesg.

This patch solves the problem by increasing the transfer request to 4
bytes instead of 2. The fix isn't particularly elegant, but it is simple
and safe to backport to stable kernels. A further patch will follow to
more elegantly handle battery reports that contain additional data.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Darren Hart <darren@dvhart.com>
Cc: Jiri Kosina <jikos@kernel.org>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: stable@vger.kernel.org
Tested-by: Darren Hart <dvhart@infradead.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-07-14 15:16:54 +02:00
..
accessibility
acpi
amba
android
ata
atm
auxdisplay
base Merge branch 'akpm' (patches from Andrew) 2020-06-03 20:24:15 -07:00
bcma
block
bluetooth
bus
cdrom
char
clk
clocksource
connector
counter
cpufreq
cpuidle
crypto
dax
dca
devfreq
dio
dma
dma-buf
edac
eisa
extcon
firewire
firmware
fpga
fsi
gnss
gpio
gpu media updates for v5.8-rc1 2020-06-03 20:59:38 -07:00
greybus
hid HID: input: Fix devices that return multiple bytes in battery report 2020-07-14 15:16:54 +02:00
hsi
hv
hwmon
hwspinlock
hwtracing
i2c
i3c
ide
idle
iio - Core Frameworks 2020-06-04 10:38:42 -07:00
infiniband
input
interconnect
iommu
ipack
irqchip
isdn
leds LEDs pull request for 5.8-rc1. 2020-06-04 11:03:45 -07:00
lightnvm
macintosh
mailbox
mcb
md
media media updates for v5.8-rc1 2020-06-03 20:59:38 -07:00
memory
memstick
message
mfd
misc
mmc
most
mtd
mux
net
nfc
ntb
nubus
nvdimm
nvme
nvmem
of
opp
oprofile
parisc
parport
pci
pcmcia Merge branch 'pcmcia-next' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux 2020-06-04 11:05:27 -07:00
perf
phy
pinctrl
platform chrome platform changes for 5.8 2020-06-04 10:54:45 -07:00
pnp
power - Core Frameworks 2020-06-04 10:38:42 -07:00
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc
s390
sbus
scsi
sfi
sh
siox
slimbus
soc
soundwire
spi
spmi
ssb
staging atomisp: avoid warning about unused function 2020-06-03 21:22:46 -07:00
target
tc
tee
thermal
thunderbolt
tty
uio
usb
vdpa
vfio
vhost
video - Core Frameworks 2020-06-04 10:43:07 -07:00
virt
virtio
visorbus
vlynq
vme
w1
watchdog linux-watchdog 5.8-rc1 tag 2020-06-04 10:50:22 -07:00
xen
zorro
Kconfig
Makefile