stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Kosina <jikos@kernel.org>
To: "Gerecke, Jason" <killertofu@gmail.com>
Cc: linux-input@vger.kernel.org,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	Ping Cheng <pinglinux@gmail.com>,
	Aaron Armstrong Skomra <skomra@gmail.com>,
	stable@vger.kernel.org, Jason Gerecke <jason.gerecke@wacom.com>,
	Aaron Armstrong Skomra <aaron.skomra@wacom.com>
Subject: Re: [PATCH] HID: wacom: generic: Treat serial number and related fields as unsigned
Date: Wed, 6 Nov 2019 21:38:43 +0100 (CET)	[thread overview]
Message-ID: <nycvar.YFH.7.76.1911062138270.1799@cbobk.fhfr.pm> (raw)
In-Reply-To: <20191106195946.552879-1-jason.gerecke@wacom.com>

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

> From: Jason Gerecke <killertofu@gmail.com>
> 
> 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@vger.kernel.org> # v4.10+
> Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
> Reviewed-by: Aaron Armstrong Skomra <aaron.skomra@wacom.com>

Applied to for-5.4/upstream-fixes.

-- 
Jiri Kosina
SUSE Labs


      reply	other threads:[~2019-11-06 20:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-06 19:59 [PATCH] HID: wacom: generic: Treat serial number and related fields as unsigned Gerecke, Jason
2019-11-06 20:38 ` Jiri Kosina [this message]

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=nycvar.YFH.7.76.1911062138270.1799@cbobk.fhfr.pm \
    --to=jikos@kernel.org \
    --cc=aaron.skomra@wacom.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=jason.gerecke@wacom.com \
    --cc=killertofu@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=pinglinux@gmail.com \
    --cc=skomra@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).