From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: "Gerecke, Jason" <killertofu@gmail.com>
Cc: linux-input@vger.kernel.org, Jiri Kosina <jikos@kernel.org>,
Benjamin Tissoires <benjamin.tissoires@redhat.com>,
Ping Cheng <pinglinux@gmail.com>,
Joshua Dickens <Joshua@joshua-dickens.com>,
Aaron Armstrong Skomra <skomra@gmail.com>,
"Tobita, Tatsunosuke" <tatsunosuke.tobita@wacom.com>,
stable@vger.kernel.org, Jason Gerecke <jason.gerecke@wacom.com>
Subject: Re: [PATCH] HID: wacom: Do not register input devices until after hid_hw_start
Date: Mon, 29 Jan 2024 16:03:23 -0800 [thread overview]
Message-ID: <Zbg8yxO91S9_DZl9@google.com> (raw)
In-Reply-To: <20240129223545.219878-1-jason.gerecke@wacom.com>
On Mon, Jan 29, 2024 at 02:35:45PM -0800, Gerecke, Jason wrote:
> From: Jason Gerecke <killertofu@gmail.com>
>
> If a input device is opened before hid_hw_start is called, events may
> not be received from the hardware. In the case of USB-backed devices,
> for example, the hid_hw_start function is responsible for filling in
> the URB which is submitted when the input device is opened. If a device
> is opened prematurely, polling will never start because the device will
> not have been in the correct state to send the URB.
>
> Because the wacom driver registers its input devices before calling
> hid_hw_start, there is a window of time where a device can be opened
> and end up in an inoperable state. Some ARM-based Chromebooks in particular
> reliably trigger this bug.
>
> This commit splits the wacom_register_inputs function into two pieces.
> One which is responsible for setting up the allocated inputs (and runs
> prior to hid_hw_start so that devices are ready for any input events
> they may end up receiving) and another which only registers the devices
> (and runs after hid_hw_start to ensure devices can be immediately opened
> without issue). Note that the functions to initialize the LEDs and remotes
> are also moved after hid_hw_start to maintain their own dependency chains.
>
> Fixes: 7704ac937345 ("HID: wacom: implement generic HID handling for pen generic devices")
> Cc: stable@vger.kernel.org # v3.18+
> Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Tested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Thanks.
--
Dmitry
next prev parent reply other threads:[~2024-01-30 0:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-29 22:35 [PATCH] HID: wacom: Do not register input devices until after hid_hw_start Gerecke, Jason
2024-01-30 0:03 ` Dmitry Torokhov [this message]
2024-02-06 15:12 ` Jiri Kosina
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=Zbg8yxO91S9_DZl9@google.com \
--to=dmitry.torokhov@gmail.com \
--cc=Joshua@joshua-dickens.com \
--cc=benjamin.tissoires@redhat.com \
--cc=jason.gerecke@wacom.com \
--cc=jikos@kernel.org \
--cc=killertofu@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=pinglinux@gmail.com \
--cc=skomra@gmail.com \
--cc=stable@vger.kernel.org \
--cc=tatsunosuke.tobita@wacom.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.