Re: [PATCH] HID: wacom: generic: Treat serial number and related fields as unsigned

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 6 Nov 2019, Gerecke, Jason wrote:

> From: Jason Gerecke <killertofu@xxxxxxxxx>
> 
> The HID descriptors for most Wacom devices oddly declare the serial
> number and other related fields as signed integers. When these numbers
> are ingested by the HID subsystem, they are automatically sign-extended
> into 32-bit integers. We treat the fields as unsigned elsewhere in the
> kernel and userspace, however, so this sign-extension causes problems.
> In particular, the sign-extended tool ID sent to userspace as ABS_MISC
> does not properly match unsigned IDs used by xf86-input-wacom and libwacom.
> 
> We introduce a function 'wacom_s32tou' that can undo the automatic sign
> extension performed by 'hid_snto32'. We call this function when processing
> the serial number and related fields to ensure that we are dealing with
> and reporting the unsigned form. We opt to use this method rather than
> adding a descriptor fixup in 'wacom_hid_usage_quirk' since it should be
> more robust in the face of future devices.
> 
> Ref: https://github.com/linuxwacom/input-wacom/issues/134
> Fixes: f85c9dc678 ("HID: wacom: generic: Support tool ID and additional tool types")
> CC: <stable@xxxxxxxxxxxxxxx> # v4.10+
> Signed-off-by: Jason Gerecke <jason.gerecke@xxxxxxxxx>
> Reviewed-by: Aaron Armstrong Skomra <aaron.skomra@xxxxxxxxx>

Applied to for-5.4/upstream-fixes.

-- 
Jiri Kosina
SUSE Labs




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux