kernel_samsung_a53x/drivers/hid
Jason Gerecke 009b9be79f HID: wacom: Do not register input devices until after hid_hw_start
commit c1d6708bf0d3dd976460d435373cf5abf21ce258 upstream.

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>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-18 12:13:29 +01:00
..
i2c-hid Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
intel-ish-hid Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
usbhid Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-a4tech.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-accutouch.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-alps.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-apple.c HID: apple: Add 2021 magic keyboard FN key mapping 2024-11-18 12:13:23 +01:00
hid-appleir.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-asus.c HID: hid-asus: add const to read-only outgoing usb buffer 2024-11-18 12:11:57 +01:00
hid-aureal.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-axff.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-belkin.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-betopff.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-bigbenff.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-cherry.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-chicony.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-cmedia.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-core.c HID: fix HID device resource race between HID core and debugging support 2024-11-18 12:10:54 +01:00
hid-corsair.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-cougar.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-cp2112.c hid: cp2112: Fix IRQ shutdown stopping polling for all IRQs on chip 2024-11-18 11:43:04 +01:00
hid-creative-sb0540.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-cypress.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-debug.c HID: fix HID device resource race between HID core and debugging support 2024-11-18 12:10:54 +01:00
hid-dr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-elan.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-elecom.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-elo.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-emsff.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-ezkey.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-gaff.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-gembird.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-generic.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-gfrm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-glorious.c HID: glorious: fix Glorious Model I HID report 2024-11-18 12:11:56 +01:00
hid-google-hammer.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-gt683r.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-gyration.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-holtek-kbd.c HID: holtek: fix slab-out-of-bounds Write in holtek_kbd_input_event 2024-11-08 11:26:16 +01:00
hid-holtek-mouse.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-holtekff.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-hyperv.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-icade.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-ids.h HID: apple: Add support for the 2021 Magic Keyboard 2024-11-18 12:13:23 +01:00
hid-input.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-ite.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-jabra.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-kensington.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-keytouch.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-kye.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-lcpower.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-led.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-lenovo.c HID: lenovo: Restrict detection of patched firmware only to USB cptkbd 2024-11-18 12:11:48 +01:00
hid-lg-g15.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-lg.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-lg.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-lg2ff.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-lg3ff.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-lg4ff.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-lg4ff.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-lgff.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-logitech-dj.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-logitech-hidpp.c HID: logitech-hidpp: Move get_wireless_feature_index() check to hidpp_connect_event() 2024-11-18 11:43:04 +01:00
hid-macally.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-magicmouse.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-maltron.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-mcp2221.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-mf.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-microsoft.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-monterey.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-multitouch.c HID: multitouch: Add quirk for HONOR GLO-GXXX touchpad 2024-11-18 12:11:56 +01:00
hid-nintendo.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-nti.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-ntrig.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-ortek.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-penmount.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-petalynx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-picolcd.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-picolcd_backlight.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-picolcd_cir.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-picolcd_core.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-picolcd_debugfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-picolcd_fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-picolcd_lcd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-picolcd_leds.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-pl.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-plantronics.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-playstation.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-primax.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-prodikeys.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-quirks.c HID: apple: Add support for the 2021 Magic Keyboard 2024-11-18 12:13:23 +01:00
hid-redragon.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-retrode.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-rmi.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-arvo.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-arvo.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-common.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-common.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-isku.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-isku.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-kone.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-kone.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-koneplus.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-koneplus.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-konepure.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-kovaplus.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-kovaplus.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-lua.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-lua.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-pyra.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-pyra.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-ryos.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-savu.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-savu.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-saitek.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-samsung.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-sensor-custom.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-sensor-hub.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-sjoy.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-sony.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-speedlink.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-steam.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-steelseries.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-sunplus.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-tivo.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-tmff.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-topseed.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-twinhan.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-u2fzero.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-uclogic-core.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-uclogic-params.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-uclogic-params.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-uclogic-rdesc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-uclogic-rdesc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-udraw-ps3.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-viewsonic.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-vivaldi.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-waltop.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-wiimote-core.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-wiimote-debug.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-wiimote-modules.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-wiimote.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-xinmo.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-zpff.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-zydacron.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hidraw.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
uhid.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
wacom.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
wacom_sys.c HID: wacom: Do not register input devices until after hid_hw_start 2024-11-18 12:13:29 +01:00
wacom_wac.c HID: wacom: generic: Avoid reporting a serial of '0' to userspace 2024-11-18 12:13:29 +01:00
wacom_wac.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00