Re: [PATCH] HID: wacom: Do not register input devices until after hid_hw_start

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

 



On Mon, Jan 29, 2024 at 02:35:45PM -0800, Gerecke, Jason wrote:
> From: Jason Gerecke <killertofu@xxxxxxxxx>
> 
> 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@xxxxxxxxxxxxxxx # v3.18+
> Suggested-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
> Signed-off-by: Jason Gerecke <jason.gerecke@xxxxxxxxx>

Tested-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>

Thanks.

-- 
Dmitry




[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux